Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1479422pxk; Fri, 25 Sep 2020 16:29:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJykWujDpzawof15c91NU4oU2+7MVyZEcFph+5xiw+7QMqpEaH80+HO9wEJzhBKsjO0H/cjz X-Received: by 2002:a17:906:715b:: with SMTP id z27mr5436475ejj.166.1601076558357; Fri, 25 Sep 2020 16:29:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601076558; cv=none; d=google.com; s=arc-20160816; b=RfmgwVzA1OXDz0gc8GrX/Z83I2EJh+6wMcqIlMXhgprOSwNJK70s1N3Ut/hmfhUfkG WC6uOC66msSeEwgWJX1irVPJalQ2OhTKmDbclfwUW8O34bo6PmWdFqOrQFD8aXtKEt9J U7qII3KwdyV/AAUl9UY88ihJrHxeqgSE9fBl5HSJp7NleazsNpWDqgwUNS+dCcErLESk qtRvaN6TpaIP6LMqYOaT0j6GQPRjDf5QSLx0V/m/z7lCdD/cvSkkoO+zoRhrsnxpGqcf +fGQyr8zHTovjREXnD8EFQ3O/oGf/rs1Fyz8EcBy6XcBYmJpFdbvyExFAoIYJ9SDYQju QMFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:content-disposition:mime-version :message-id:subject:cc:to:from:date; bh=HfY0Pd95EHOMK8KHuIp1RFKeQxhAIh1xTyV0sVNguEQ=; b=fzGNdz2haDkcnJ2al8hxw0lvWrPHuGY8PvRFAxy8QePJE7GuBSEL6cZPLbP4vrd4Vy 5PlySMhVdyQGoykBeeCCd0Zk0SNMGBxBr/N4bmrPHcPrtC2ExfcGEA7jz9/ervbs2KfE /qiNGFVV/xc9YhE9Y7cN8JBqef7NoitZjajIzCAewxEZ/5ZByK/mKYUhOimTZFbjrH7b 3SYpk2RNR1bftHVuRCfsRG5J2kPZPfg0Wpn5oDOhvdPuvwCgFqAapaT4S2UY8n2duU2/ oiLXfSwPIUXB/lSZW1MIVi1fuJ6zJGRJGZEPUTNaetY75p953g+jdU1gf6l84/b3/s1b pyog== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e24si2971573ejx.162.2020.09.25.16.28.55; Fri, 25 Sep 2020 16:29:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729409AbgIYX0q (ORCPT + 99 others); Fri, 25 Sep 2020 19:26:46 -0400 Received: from agrajag.zerfleddert.de ([88.198.237.222]:38860 "EHLO agrajag.zerfleddert.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726773AbgIYX0q (ORCPT ); Fri, 25 Sep 2020 19:26:46 -0400 X-Greylist: delayed 501 seconds by postgrey-1.27 at vger.kernel.org; Fri, 25 Sep 2020 19:26:45 EDT Received: by agrajag.zerfleddert.de (Postfix, from userid 1000) id BE53B5B20838; Sat, 26 Sep 2020 01:26:44 +0200 (CEST) Date: Sat, 26 Sep 2020 01:26:44 +0200 From: Tobias Jordan To: linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Pavel Machek , Dan Murphy , Nikita Travkin Subject: [PATCH] leds: aw2013: fix leak of device node iterator Message-ID: <20200925232644.GA17005@agrajag.zerfleddert.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In the error path of the for_each_available_child_of_node loop in aw2013_probe_dt, add missing call to of_node_put to avoid leaking the iterator. Fixes: 59ea3c9faf32 ("leds: add aw2013 driver") Signed-off-by: Tobias Jordan --- drivers/leds/leds-aw2013.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/leds/leds-aw2013.c b/drivers/leds/leds-aw2013.c index d709cc1f949e..8687ffa57a28 100644 --- a/drivers/leds/leds-aw2013.c +++ b/drivers/leds/leds-aw2013.c @@ -305,8 +305,10 @@ static int aw2013_probe_dt(struct aw2013 *chip) ret = devm_led_classdev_register_ext(&chip->client->dev, &led->cdev, &init_data); - if (ret < 0) + if (ret < 0) { + of_node_put(child); return ret; + } i++; } -- 2.20.1