leds: triggers: Check return value of kobject_uevent_env()
authorJacek Anaszewski <j.anaszewski@samsung.com>
Mon, 19 Sep 2016 10:44:50 +0000 (12:44 +0200)
committerJacek Anaszewski <j.anaszewski@samsung.com>
Tue, 20 Sep 2016 08:22:10 +0000 (10:22 +0200)
Log error message if kobject_uevent_env() fails in led_trigger_set().

Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/leds/led-triggers.c

index c7a38d43ff623d7c6591c81f619d45aa6a00d52c..431123b048a27cb5f5146321982fd880e4db5938 100644 (file)
@@ -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);
        }
 }