led: triggers: Fix dereferencing of null pointer
authorOleh Kravchenko <oleg@kaa.org.ua>
Tue, 3 Sep 2019 21:18:19 +0000 (00:18 +0300)
committerJacek Anaszewski <jacek.anaszewski@gmail.com>
Thu, 5 Sep 2019 20:32:45 +0000 (22:32 +0200)
commit4016ba85880b252365d11bc7dc899450f2c73ad7
tree166da76915831a255a43ea740cc192d24b4a6642
parentba7eb84f71692d6ece8d5782ab1658fe7f6c0cad
led: triggers: Fix dereferencing of null pointer

Error was detected by PVS-Studio:
V522 Dereferencing of the null pointer 'led_cdev->trigger' might take place.

Fixes: 2282e125a406 ("leds: triggers: let struct led_trigger::activate() return an error code")
Signed-off-by: Oleh Kravchenko <oleg@kaa.org.ua>
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
drivers/leds/led-triggers.c