[Linux-kernel-mentees] [PATCH] usb: appledisplay: fix use-after-free in bl_get_brightness

Oliver Neukum oneukum at suse.com
Thu Nov 7 08:50:29 UTC 2019


Am Mittwoch, den 06.11.2019, 21:22 +0700 schrieb Phong Tran:

> compare with message size (2) can be considered.
> 
> if (retval == 2) {
> 	brightness = pdata->msgdata[1];
> } else {
> 	retval = -EMSGSIZE;
> }

If you do it that way, the error reporting will be distorted.
Hence I did it a bit more complexly.

	Regards
		Oliver


More information about the Linux-kernel-mentees mailing list