[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20160920070920.GC9768@kroah.com>
Date: Tue, 20 Sep 2016 09:09:20 +0200
From: Greg KH <greg@...ah.com>
To: Jacek Anaszewski <j.anaszewski@...sung.com>
Cc: linux-leds@...r.kernel.org, linux-kernel@...r.kernel.org,
joe@...ches.com
Subject: Re: [PATCH v3] leds: triggers: Check return value of
kobject_uevent_env()
On Mon, Sep 19, 2016 at 12:52:24PM +0200, Jacek Anaszewski wrote:
> Log error message if kobject_uevent_env() fails in led_trigger_set().
>
> Signed-off-by: Jacek Anaszewski <j.anaszewski@...sung.com>
> ---
> Changes from v1:
> - switched to using dev_err() instead of pr_err()
> Changes from v2:
> - switched to using __func__ instead of explicit function name,
> to simplify code maintenance
>
> drivers/leds/led-triggers.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/leds/led-triggers.c b/drivers/leds/led-triggers.c
> index c7a38d4..431123b 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);
> }
> }
> --
> 1.9.1
Acked-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Powered by blists - more mailing lists