From: Greg KH <greg@kroah.com>
To: Jacek Anaszewski <j.anaszewski@samsung.com>
Cc: linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org,
joe@perches.com
Subject: Re: [PATCH v3] leds: triggers: Check return value of kobject_uevent_env()
Date: Tue, 20 Sep 2016 09:09:20 +0200 [thread overview]
Message-ID: <20160920070920.GC9768@kroah.com> (raw)
In-Reply-To: <1474282344-11496-1-git-send-email-j.anaszewski@samsung.com>
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@samsung.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@linuxfoundation.org>
prev parent reply other threads:[~2016-09-20 7:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-19 10:52 [PATCH v3] leds: triggers: Check return value of kobject_uevent_env() Jacek Anaszewski
2016-09-20 7:09 ` Greg KH [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160920070920.GC9768@kroah.com \
--to=greg@kroah.com \
--cc=j.anaszewski@samsung.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).