All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
To: Jacek Anaszewski <j.anaszewski@samsung.com>
Cc: Bryan Wu <cooloney@gmail.com>, Richard Purdie <rpurdie@rpsys.net>,
	linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] leds: gpio: Fix device teardown on probe deferral
Date: Wed, 15 Apr 2015 11:29:52 +0200	[thread overview]
Message-ID: <552E2F90.30402@gmail.com> (raw)
In-Reply-To: <552E2B53.8030002@samsung.com>

On 04/15/2015 11:11 AM, Jacek Anaszewski wrote:
> On 04/14/2015 11:23 PM, Sebastian Hesselbarth wrote:
>> In gpio_leds_create(), when devm_get_gpiod_from_child() fails with
>> -EPROBE_DEFER on the second gpio led to be created, the first already
>> registered led is not torn down properly. This causes create_gpio_led()
>> to fail for the first led on re-probe().
>>
>> Fix this misbehaviour by incrementing num_leds only if all
>> potentially failing calls completed successfully.
>>
>> Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
>> ---
>> Cc: Bryan Wu <cooloney@gmail.com>
>> Cc: Richard Purdie <rpurdie@rpsys.net>
>> Cc: linux-leds@vger.kernel.org
>> Cc: linux-kernel@vger.kernel.org
>> ---
>>   drivers/leds/leds-gpio.c | 5 +++--
>>   1 file changed, 3 insertions(+), 2 deletions(-)
>
> For this patch:
>
> Acked-by: Jacek Anaszewski <j.anaszewski@samsung.com>

Jacek, Thanks!

> I have a question regarding the sequence above on line 201:
>
> if (!led.name)
>      return ERR_PTR(-EINVAL);
>
> Shouldn't this be also 'goto err"?

Yes, every error within the loop has to goto the err label.
Mind to send a patch fixing it?

Sebastian

  reply	other threads:[~2015-04-15  9:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-14 21:23 [PATCH] leds: gpio: Fix device teardown on probe deferral Sebastian Hesselbarth
2015-04-15  9:11 ` Jacek Anaszewski
2015-04-15  9:29   ` Sebastian Hesselbarth [this message]
2015-04-15  9:52     ` Jacek Anaszewski
2015-04-20 18:23   ` Bryan Wu

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=552E2F90.30402@gmail.com \
    --to=sebastian.hesselbarth@gmail.com \
    --cc=cooloney@gmail.com \
    --cc=j.anaszewski@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=rpurdie@rpsys.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.