Re: [PATCH] usb: appledisplay: fix use-after-free in bl_get_brightness

From: Oliver Neukum
Date: Thu Nov 07 2019 - 04:06:34 EST


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