From: Jacek Anaszewski Date: Mon, 19 Sep 2016 10:44:50 +0000 (+0200) Subject: leds: triggers: Check return value of kobject_uevent_env() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6f3bad9670729ea3a7c78b3752a89c94ffa2397a;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git leds: triggers: Check return value of kobject_uevent_env() Log error message if kobject_uevent_env() fails in led_trigger_set(). Signed-off-by: Jacek Anaszewski Acked-by: Greg Kroah-Hartman --- diff --git a/drivers/leds/led-triggers.c b/drivers/leds/led-triggers.c index c7a38d43ff62..431123b048a2 100644 --- a/drivers/leds/led-triggers.c +++ b/drivers/leds/led-triggers.c @@ -141,7 +141,9 @@ void led_trigger_set(struct led_classdev *led_cdev, struct led_trigger *trig) if (event) { envp[0] = event; envp[1] = NULL; - kobject_uevent_env(&led_cdev->dev->kobj, KOBJ_CHANGE, envp); + if (kobject_uevent_env(&led_cdev->dev->kobj, KOBJ_CHANGE, envp)) + dev_err(led_cdev->dev, + "%s: Error sending uevent\n", __func__); kfree(event); } }