leds: lp5523: check return value of lp5xx_read and jump to cleanup code
authorPhillip Potter <phil@philpotter.co.uk>
Mon, 3 May 2021 11:56:36 +0000 (13:56 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 May 2021 10:06:56 +0000 (12:06 +0200)
commit865ec95a77f7ff3480c9a0ab1da3336c943e5846
tree736b132975371a33166ce5aab9f0ee6de108d261
parent33a9ff900b9b03997aabf0dba887b11f93c2f47c
leds: lp5523: check return value of lp5xx_read and jump to cleanup code

commit 6647f7a06eb030a2384ec71f0bb2e78854afabfe upstream.

Check return value of lp5xx_read and if non-zero, jump to code at end of
the function, causing lp5523_stop_all_engines to be executed before
returning the error value up the call chain. This fixes the original
commit (248b57015f35) which was reverted due to the University of Minnesota
problems.

Cc: stable <stable@vger.kernel.org>
Acked-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210503115736.2104747-10-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/leds/leds-lp5523.c