From: Bryan Wu <cooloney@gmail.com>
To: Jacek Anaszewski <j.anaszewski@samsung.com>
Cc: Linux LED Subsystem <linux-leds@vger.kernel.org>,
Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
Richard Purdie <rpurdie@rpsys.net>
Subject: Re: [PATCH] leds: gpio: Fix error handling for led name null pointer case
Date: Mon, 20 Apr 2015 11:35:25 -0700 [thread overview]
Message-ID: <CAK5ve-+FyDHQ01UnENcCaJOy_+ExcCQksT9ozVBtyx_j+Yh2Vg@mail.gmail.com> (raw)
In-Reply-To: <1429169450-11791-1-git-send-email-j.anaszewski@samsung.com>
On Thu, Apr 16, 2015 at 12:30 AM, Jacek Anaszewski
<j.anaszewski@samsung.com> wrote:
> Make sure that already registered LEDs will be torn down properly
> if the name of the next LED to create is unavailable.
>
Thanks, merged.
-Bryan
> Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
> Cc: Bryan Wu <cooloney@gmail.com>
> Cc: Richard Purdie <rpurdie@rpsys.net>
> ---
> drivers/leds/leds-gpio.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c
> index 25df4a2..c3db74a 100644
> --- a/drivers/leds/leds-gpio.c
> +++ b/drivers/leds/leds-gpio.c
> @@ -198,8 +198,10 @@ static struct gpio_leds_priv *gpio_leds_create(struct platform_device *pdev)
> } else {
> if (IS_ENABLED(CONFIG_OF) && !led.name && np)
> led.name = np->name;
> - if (!led.name)
> - return ERR_PTR(-EINVAL);
> + if (!led.name) {
> + ret = -EINVAL;
> + goto err;
> + }
> }
> fwnode_property_read_string(child, "linux,default-trigger",
> &led.default_trigger);
> --
> 1.7.9.5
>
parent reply other threads:[~2015-04-20 18:35 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <1429169450-11791-1-git-send-email-j.anaszewski@samsung.com>]
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=CAK5ve-+FyDHQ01UnENcCaJOy_+ExcCQksT9ozVBtyx_j+Yh2Vg@mail.gmail.com \
--to=cooloney@gmail.com \
--cc=j.anaszewski@samsung.com \
--cc=linux-leds@vger.kernel.org \
--cc=rpurdie@rpsys.net \
--cc=sebastian.hesselbarth@gmail.com \
/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).