Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755823AbbDTSYP (ORCPT ); Mon, 20 Apr 2015 14:24:15 -0400 Received: from mail-pd0-f175.google.com ([209.85.192.175]:34388 "EHLO mail-pd0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752173AbbDTSYM (ORCPT ); Mon, 20 Apr 2015 14:24:12 -0400 MIME-Version: 1.0 In-Reply-To: <552E2B53.8030002@samsung.com> References: <1429046610-3001-1-git-send-email-sebastian.hesselbarth@gmail.com> <552E2B53.8030002@samsung.com> From: Bryan Wu Date: Mon, 20 Apr 2015 11:23:51 -0700 Message-ID: Subject: Re: [PATCH] leds: gpio: Fix device teardown on probe deferral To: Jacek Anaszewski Cc: Sebastian Hesselbarth , Richard Purdie , Linux LED Subsystem , lkml Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1427 Lines: 48 On Wed, Apr 15, 2015 at 2:11 AM, Jacek Anaszewski 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 >> --- >> 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 > 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 -- 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/