Re: [PATCH] leds: fix a missing check of return value of lp55xx_read

2018-12-28 Thread Jacek Anaszewski
Hi Kangjie, Thank you for the patch. On 12/26/18 5:18 AM, Kangjie Lu wrote: When lp55xx_read() fails, "status" is an uninitialized variable and thus may contain random value; using it leads to undefined behaviors. The fix inserts a check for the return value of lp55xx_read: if it fails, return

[PATCH] leds: fix a missing check of return value of lp55xx_read

2018-12-25 Thread Kangjie Lu
When lp55xx_read() fails, "status" is an uninitialized variable and thus may contain random value; using it leads to undefined behaviors. The fix inserts a check for the return value of lp55xx_read: if it fails, returns with its error code. Signed-off-by: Kangjie Lu --- drivers/leds/leds-lp5523