linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] leds: gpio: Fix error handling for led name null pointer case
       [not found] <1429169450-11791-1-git-send-email-j.anaszewski@samsung.com>
@ 2015-04-20 18:35 ` Bryan Wu
  0 siblings, 0 replies; only message in thread
From: Bryan Wu @ 2015-04-20 18:35 UTC (permalink / raw)
  To: Jacek Anaszewski
  Cc: Linux LED Subsystem, Sebastian Hesselbarth, Richard Purdie

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
>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-04-20 18:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1429169450-11791-1-git-send-email-j.anaszewski@samsung.com>
2015-04-20 18:35 ` [PATCH] leds: gpio: Fix error handling for led name null pointer case Bryan Wu

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).