lkml.org 
[lkml]   [2015]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] leds: gpio: Fix device teardown on probe deferral
On Wed, Apr 15, 2015 at 2:11 AM, Jacek Anaszewski
<j.anaszewski@samsung.com> wrote:
> Hi Sebastian,
>
> 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>
>

Thanks, I merged it.
-Bryan

> 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"?
>
> --
> Best Regards,
> Jacek Anaszewski


\
 
 \ /
  Last update: 2015-04-20 20:41    [W:0.069 / U:1.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site