]> git.baikalelectronics.ru Git - kernel.git/commit
leds: lp5523: fix a missing check of return value of lp55xx_read
authorKangjie Lu <kjlu@umn.edu>
Wed, 26 Dec 2018 04:18:23 +0000 (22:18 -0600)
committerJacek Anaszewski <jacek.anaszewski@gmail.com>
Thu, 17 Jan 2019 21:27:39 +0000 (22:27 +0100)
commit1edda4d77426e0e5edfe440767f2147d4dd68979
tree880652e44f82321bb1c3130f2636b42ce80d2b2a
parentd6952d4b95d3a6897fcea7446c97f59f8d24556b
leds: lp5523: fix a missing check of return value of lp55xx_read

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 <kjlu@umn.edu>
Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
drivers/leds/leds-lp5523.c