Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1475160pxk; Fri, 25 Sep 2020 16:19:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxz9wRrXBR3JdpjRV7n6PGBKD2My7BIYAtNX4LQ70Oq1GIJ1iK3EaDoAFOsjAT4eCNbU8bg X-Received: by 2002:a50:fe0f:: with SMTP id f15mr3900617edt.235.1601075995306; Fri, 25 Sep 2020 16:19:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601075995; cv=none; d=google.com; s=arc-20160816; b=M08MKXeDIiwevQ66fB2FJlOvBXlcfMsm64jsn1l0GX+u2KvOiN2mq1YgErddz8UATm fc4sEMVK0Zp3TArqm9UWSMQdndwTGU4FeMs4RmOXTsNUZolJTSIMWoOqeBHjS8RH2M1X GOdLl3CVKYTQofykbXe0wVm5L9RMkGurJTL+80cx5dv2F1ipRPFGGktgK5XcyRqbb9y7 I1+AjhJKTeN5nx9Dl3vrP43v8Cv+Qu4YxDQ8xEaoTu2bt95pEm5M4/45ycHews+5H9YH R5T+wuomgnNRjSti+HU8gj+/sf9N4EFrd4q5hRAZnqoV/x2RRt31HXLBisj36qgeIEX1 DjmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=EMNvlxWjijYUz4hmFQAlCgNywg23OPlklVtH4HMgWXg=; b=xqcfWo+IJCYoDkytzDkDyklePqS6wv4nTsD43D4cLQOKvXMcaKntqXm46oGF7zest/ JVLOYjjdYtxJHwJQUBs/Fwq4ujqG2RO9eQvTQjFPujaDXrn0bzzaWWeZW4V1ZIwWSiyr O6QVAhv1EOZ4+16V2Tx47OcPeRev6XPWjq8Htif+elO9rFyWOiMiRO1ApjcxQ31aj3t/ qVNhozG12xbpgF+14Sr+J+o1H+f1i3kCGX4rlylg4vpkFNAWcV/5w4ytjOpHq7STThCK m1Fa2kMeeLx37u8AjqXW5/jQtwocHxn+lcNwOfgFKCH+CDGeDaighHUTz+pM5FAf8aja Fb5A== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nic.cz Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v2si2770445ejw.741.2020.09.25.16.19.32; Fri, 25 Sep 2020 16:19:55 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nic.cz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729181AbgIYXQP (ORCPT + 99 others); Fri, 25 Sep 2020 19:16:15 -0400 Received: from mail.nic.cz ([217.31.204.67]:53640 "EHLO mail.nic.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727258AbgIYXQO (ORCPT ); Fri, 25 Sep 2020 19:16:14 -0400 Received: from localhost (unknown [IPv6:2a0e:b107:ae1:0:3e97:eff:fe61:c680]) by mail.nic.cz (Postfix) with ESMTPSA id 8E54B140079; Sat, 26 Sep 2020 01:16:12 +0200 (CEST) Date: Sat, 26 Sep 2020 01:16:12 +0200 From: Marek Behun To: Tobias Jordan Cc: linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, Pavel Machek , Dan Murphy , Jacek Anaszewski Subject: Re: [PATCH] leds: lp55xx: fix device node iterator memory leaks Message-ID: <20200926011612.37a50904@nic.cz> In-Reply-To: <20200925225905.GA11731@agrajag.zerfleddert.de> References: <20200925225905.GA11731@agrajag.zerfleddert.de> X-Mailer: Claws Mail 3.17.6 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-100.0 required=5.9 tests=SHORTCIRCUIT, USER_IN_WELCOMELIST,USER_IN_WHITELIST shortcircuit=ham autolearn=disabled version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.nic.cz X-Virus-Scanned: clamav-milter 0.102.2 at mail X-Virus-Status: Clean Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 26 Sep 2020 00:59:05 +0200 Tobias Jordan wrote: > Fix error paths in for_each_child_of_node loops that were missing an > of_node_put call. > > Fixes: 92a81562e695 ("leds: lp55xx: Add multicolor framework support to > lp55xx") > Signed-off-by: Tobias Jordan > --- > drivers/leds/leds-lp55xx-common.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/drivers/leds/leds-lp55xx-common.c b/drivers/leds/leds-lp55xx-common.c > index 56210f4ad919..f8b55cfd21ef 100644 > --- a/drivers/leds/leds-lp55xx-common.c > +++ b/drivers/leds/leds-lp55xx-common.c > @@ -614,8 +614,10 @@ static int lp55xx_parse_multi_led(struct device_node *np, > for_each_child_of_node(np, child) { > ret = lp55xx_parse_multi_led_child(child, cfg, child_number, > num_colors); > - if (ret) > + if (ret) { > + of_node_put(child); > return ret; > + } > num_colors++; > } > > @@ -681,8 +683,10 @@ struct lp55xx_platform_data *lp55xx_of_populate_pdata(struct device *dev, > > for_each_child_of_node(np, child) { > ret = lp55xx_parse_logical_led(child, cfg, i); > - if (ret) > + if (ret) { > + of_node_put(child); > return ERR_PTR(-EINVAL); > + } > i++; > } > This is already patched