Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754408AbbDOJMA (ORCPT ); Wed, 15 Apr 2015 05:12:00 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:40876 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751396AbbDOJLw (ORCPT ); Wed, 15 Apr 2015 05:11:52 -0400 X-AuditID: cbfec7f4-b7f106d0000013ec-84-552e2aa65673 Message-id: <552E2B53.8030002@samsung.com> Date: Wed, 15 Apr 2015 11:11:47 +0200 From: Jacek Anaszewski User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130804 Thunderbird/17.0.8 MIME-version: 1.0 To: Sebastian Hesselbarth Cc: Bryan Wu , Richard Purdie , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] leds: gpio: Fix device teardown on probe deferral References: <1429046610-3001-1-git-send-email-sebastian.hesselbarth@gmail.com> In-reply-to: <1429046610-3001-1-git-send-email-sebastian.hesselbarth@gmail.com> Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKLMWRmVeSWpSXmKPExsVy+t/xy7rLtfRCDZ5zWxzdOZHJ4vKuOWwW W9+sY7TYvespq8X7n44OrB47Z91l99gz/werx+dNcgHMUVw2Kak5mWWpRfp2CVwZL87NZymY xlFxdfpRxgbGO2xdjJwcEgImEnNWHYSyxSQu3FsPZHNxCAksZZS4tOERK4TzkVHi4MR3LCBV vAJaEuevtDF3MXJwsAioSlw7qg8SZhMwlPj54jUTiC0qECHx5/Q+VohyQYkfk++xgJSLCFhL vGgpAQkzCzQySvS2ioDYwgJuEjs7loOVCAn4SbRO1QQJcwr4S3w5u54VotxaYuWkbYwQtrzE 5jVvmScwCsxCsmAWkrJZSMoWMDKvYhRNLU0uKE5KzzXUK07MLS7NS9dLzs/dxAgJ2i87GBcf szrEKMDBqMTD+yFfJ1SINbGsuDL3EKMEB7OSCG+CoF6oEG9KYmVValF+fFFpTmrxIUYmDk6p BkaNxS9f8zwx+MQcUauW3P2qZsHjmu5PVzT9bqfxlt749OuodYrD1MfZAccnLQx8f/taZ1bi T3OVfLO/buvsmff3PZ4g4XoqwWmaj8KUZ6Ycy6fIqG73v3ByvkpiwB3xwgVFPKdjxINfH/Nv OLlqbu155fe1Z7W0mHjm1Vo/ZhFz0bOX0dxQtEeJpTgj0VCLuag4EQA5FsLQOAIAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1256 Lines: 40 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 > --- > 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 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/