Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1249661pxb; Fri, 26 Feb 2021 06:25:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJwN3RijCEDmmiQR+9TdodqDzieYwpiF+7DgSg7x6ep78nLlvaM39r+j+BioiDaGsF8XyI3b X-Received: by 2002:a17:906:4349:: with SMTP id z9mr3638158ejm.471.1614349546488; Fri, 26 Feb 2021 06:25:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614349546; cv=none; d=google.com; s=arc-20160816; b=nZHVNR75dK3P4IcShJwDeWbFynBCdP4VVda3M1/0jHEdgDiEpneV7Fpzw13OE1eCTv 31yHbZymKSRK7AW2vSd/l3U3ticETg4t3A1jDWiPoz4ptZMQDOOpQqb3qo9dk91Aca0+ miDnxBuYL7nIuAu68yelZdofMDnBfcuayy8KkQcUsC3tLQonooWP8NCPG3G8U3wPyguo Pqgsqx7tWnWpuUCMUBIpbzI3xx8b8H5+gTKRZcjzu1rQQKLoiVZQiZxUCH3XUjUXPtCW JCUu2rB43t/5OHP046z4Dsne5D4vqd5xhL+V51SC2Re2lwaNYDrIvjz/xRQq6m7+lOeC R9/g== 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:cc:to:subject:from:date; bh=D4vfA8Qy1di1g/Mg+b0Mf2jXtQxhcF3vSchYZK8CSfI=; b=brQkhraQ4b+Nj5doxW2SzCjqdunnO/ykhoJmEpWvd4aRhBHwOYL2XoGJ5OPfs4P4io uUqWxoW5YB0TXaTrEs7MjI3BH9kXgp5CpZiQJzkgjmFiqtJ6R1oHGSXrZMLCpOgDrwCJ vwZDXPbnHuXShneQLKjRDFqNzjhBMtpiO9TCpkuhW73aGr2MrJh2BytlUUbn75IEBjDm f2epUBPzdGoRHoKsJuWFtN5FUb7LdUZpETZk2qlyaJGBgo3cxQl4wJL5vWEKQAFvjBNk 3V2p2iAQCEJYjmtq0xS2id8M3Q5HxZ/+hXZ4tslGfybYLP32DxSaaYC/B9rZMpUJ+s0p NFpg== 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=crapouillou.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l13si6781992edj.219.2021.02.26.06.25.24; Fri, 26 Feb 2021 06:25:46 -0800 (PST) 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=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229885AbhBZOYJ convert rfc822-to-8bit (ORCPT + 99 others); Fri, 26 Feb 2021 09:24:09 -0500 Received: from aposti.net ([89.234.176.197]:41486 "EHLO aposti.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229586AbhBZOYG (ORCPT ); Fri, 26 Feb 2021 09:24:06 -0500 Date: Fri, 26 Feb 2021 14:23:11 +0000 From: Paul Cercueil Subject: Re: [PATCH v2] pinctrl: ingenic: add missing call to of_node_put() To: Yang Li Cc: linus.walleij@linaro.org, linux-mips@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Message-Id: In-Reply-To: <1614303297-24178-1-git-send-email-yang.lee@linux.alibaba.com> References: <1614303297-24178-1-git-send-email-yang.lee@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Le ven. 26 f?vr. 2021 ? 9:34, Yang Li a ?crit : > In one of the error paths of the for_each_child_of_node() loop in > ingenic_gpio_probe, add missing call to of_node_put(). > > Fix the following coccicheck warning: > ./drivers/pinctrl/pinctrl-ingenic.c:2485:1-23: WARNING: Function > "for_each_child_of_node" should have of_node_put() before return > around > line 2489. > > Reported-by: Abaci Robot > Signed-off-by: Yang Li Acked-by: Paul Cercueil Cheers, -Paul > --- > > Changes in v2: > -add braces for if > > drivers/pinctrl/pinctrl-ingenic.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/pinctrl/pinctrl-ingenic.c > b/drivers/pinctrl/pinctrl-ingenic.c > index f274612..c8ecd01 100644 > --- a/drivers/pinctrl/pinctrl-ingenic.c > +++ b/drivers/pinctrl/pinctrl-ingenic.c > @@ -2485,8 +2485,10 @@ static int __init ingenic_pinctrl_probe(struct > platform_device *pdev) > for_each_child_of_node(dev->of_node, node) { > if (of_match_node(ingenic_gpio_of_match, node)) { > err = ingenic_gpio_probe(jzpc, node); > - if (err) > + if (err) { > + of_node_put(node); > return err; > + } > } > } > > -- > 1.8.3.1 >