From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jacek Anaszewski Subject: Re: [PATCH] leds: gpio: Fix device teardown on probe deferral Date: Wed, 15 Apr 2015 11:52:07 +0200 Message-ID: <552E34C7.2050903@samsung.com> References: <1429046610-3001-1-git-send-email-sebastian.hesselbarth@gmail.com> <552E2B53.8030002@samsung.com> <552E2F90.30402@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mailout2.w1.samsung.com ([210.118.77.12]:43413 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751575AbbDOJwM (ORCPT ); Wed, 15 Apr 2015 05:52:12 -0400 In-reply-to: <552E2F90.30402@gmail.com> Sender: linux-leds-owner@vger.kernel.org List-Id: linux-leds@vger.kernel.org To: Sebastian Hesselbarth Cc: Bryan Wu , Richard Purdie , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org On 04/15/2015 11:29 AM, Sebastian Hesselbarth wrote: > 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 >>> --- >>> Cc: Bryan Wu >>> Cc: Richard Purdie >>> 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 > > 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? OK, I'll take care of it. -- Best Regards, Jacek Anaszewski