Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753766AbbKJPch (ORCPT ); Tue, 10 Nov 2015 10:32:37 -0500 Received: from mail.kernel.org ([198.145.29.136]:42526 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752701AbbKJPcf (ORCPT ); Tue, 10 Nov 2015 10:32:35 -0500 MIME-Version: 1.0 In-Reply-To: <1447124424-16525-1-git-send-email-ingi2.kim@samsung.com> References: <1447124424-16525-1-git-send-email-ingi2.kim@samsung.com> From: Rob Herring Date: Tue, 10 Nov 2015 09:32:13 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] leds: ktd2692: Add missing of_node_put To: Ingi Kim Cc: Jacek Anaszewski , Linux LED Subsystem , "linux-kernel@vger.kernel.org" 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: 1945 Lines: 56 On Mon, Nov 9, 2015 at 9:00 PM, Ingi Kim wrote: > The refcount of device_node increases after of_node_get() is called. > So, a break out of the loop requires of_node_put(). > > This patch adds missing of_node_put() when loop breaks. > > Signed-off-by: Ingi Kim Acked-by: Rob Herring > --- > drivers/leds/leds-ktd2692.c | 11 ++++++++--- > 1 file changed, 8 insertions(+), 3 deletions(-) > > diff --git a/drivers/leds/leds-ktd2692.c b/drivers/leds/leds-ktd2692.c > index feca07b..dbf37ce 100644 > --- a/drivers/leds/leds-ktd2692.c > +++ b/drivers/leds/leds-ktd2692.c > @@ -332,21 +332,26 @@ static int ktd2692_parse_dt(struct ktd2692_context *led, struct device *dev, > &cfg->movie_max_microamp); > if (ret) { > dev_err(dev, "failed to parse led-max-microamp\n"); > - return ret; > + goto err_parse_dt; > } > > ret = of_property_read_u32(child_node, "flash-max-microamp", > &cfg->flash_max_microamp); > if (ret) { > dev_err(dev, "failed to parse flash-max-microamp\n"); > - return ret; > + goto err_parse_dt; > } > > ret = of_property_read_u32(child_node, "flash-max-timeout-us", > &cfg->flash_max_timeout); > - if (ret) > + if (ret) { > dev_err(dev, "failed to parse flash-max-timeout-us\n"); > + goto err_parse_dt; > + } > + > + return 0; > > +err_parse_dt: > of_node_put(child_node); > return ret; > } > -- > 2.0.5 > -- 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/