Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp98644yba; Thu, 11 Apr 2019 23:02:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqywn2Dj1lhyCbQNRBTobv3zg7lh14RCoB3z0f9rExht1JPft06oCd2r2yJXN1XaXNAqqMQX X-Received: by 2002:a17:902:2865:: with SMTP id e92mr33533782plb.269.1555048965896; Thu, 11 Apr 2019 23:02:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555048965; cv=none; d=google.com; s=arc-20160816; b=R1B76GoG7AoZ6lBU/Dr2e1ZIEJJXL7Ga5TsdTc9TS/WWKkOjGi6BC4qtiaWboEJW42 9kKZwpcRm6UJ2gzL77G7PXHWDWx5Q/5tXjLVvAoItIVLX39Q0thn+1kBCZbCTK3Ao/aM l3acWTUDEQjXPO6dg08n4LlZn5zdQ0euencXy4NYA8tMtZF57GbMjhjiVuFkAZjz5XmM 3ABrkvSU5xVae7oJ9dksLnI2GJerg2j7PlH6mKMuvJCwH/u+is0Z+HuZc9B2LlQJhaNz RpJbc6kVhMkx8mjATtz9ib69sVjGdQUcJ4QbMuGL3NtJsglpXnsQCzco3q9gfBNX2HII o64w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=YhS52bI3nkGhdLViZ40BoQ+bbonKI+axA/QOhMjs4Dw=; b=yQhN5XPeFzke83BjmdrclV3Zfr0QEVFx1fACZHdWQrxAmxBeAOMFiPf7Xk7Sw4XGwh QOfcRf1Bux+NZGzTvzY8eF18d0yFnsKsLRlJDf9NNqREtvzTwMp7khqJF86lStHlKSFg MgHuAIP/9dZS6QhY2qcQRr2Mm0/Bjs153JFLz5h1+0QywCF7UNZRWYYOXfXUc6kkjC1K JE9MdWozVuK2/MoiObcVYf7HvShtAGArS8gcNQPxIRi4Gkhs1oDwM0PUQHbDE1aWiYMY 5ZBW+Gkm8pTF48G3dp2Ntv3qcwPeMZI0W9JmexRvAJWx8P0VEcs6u8gGqB/xW3KJPMam 04SQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d23si38918437pfd.93.2019.04.11.23.02.30; Thu, 11 Apr 2019 23:02:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726872AbfDLGBg (ORCPT + 99 others); Fri, 12 Apr 2019 02:01:36 -0400 Received: from mxhk.zte.com.cn ([63.217.80.70]:30212 "EHLO mxhk.zte.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726636AbfDLGBe (ORCPT ); Fri, 12 Apr 2019 02:01:34 -0400 Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id EB3D5B81A3EB8C133913; Fri, 12 Apr 2019 14:01:31 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id x3C61Prp088823; Fri, 12 Apr 2019 14:01:25 +0800 (GMT-8) (envelope-from wen.yang99@zte.com.cn) Received: from fox-host8.localdomain ([10.74.120.8]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2019041214020465-8432934 ; Fri, 12 Apr 2019 14:02:04 +0800 From: Wen Yang To: linux-kernel@vger.kernel.org Cc: wang.yi59@zte.com.cn, Wen Yang , Linus Walleij , linux-gpio@vger.kernel.org Subject: [PATCH 1/5] pinctrl: pistachio: fix leaked of_node references Date: Fri, 12 Apr 2019 14:02:19 +0800 Message-Id: <1555048943-39589-2-git-send-email-wen.yang99@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1555048943-39589-1-git-send-email-wen.yang99@zte.com.cn> References: <1555048943-39589-1-git-send-email-wen.yang99@zte.com.cn> X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2019-04-12 14:02:04, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2019-04-12 14:01:11, Serialize complete at 2019-04-12 14:01:11 X-MAIL: mse01.zte.com.cn x3C61Prp088823 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The call to of_get_child_by_name returns a node pointer with refcount incremented thus it must be explicitly decremented after the last usage. Detected by coccinelle with the following warnings: ./drivers/pinctrl/pinctrl-pistachio.c:1422:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 1360, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Linus Walleij Cc: linux-gpio@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/pinctrl/pinctrl-pistachio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/pinctrl/pinctrl-pistachio.c b/drivers/pinctrl/pinctrl-pistachio.c index aa5f949..5b0678f 100644 --- a/drivers/pinctrl/pinctrl-pistachio.c +++ b/drivers/pinctrl/pinctrl-pistachio.c @@ -1367,6 +1367,7 @@ static int pistachio_gpio_register(struct pistachio_pinctrl *pctl) if (!of_find_property(child, "gpio-controller", NULL)) { dev_err(pctl->dev, "No gpio-controller property for bank %u\n", i); + of_node_put(child); ret = -ENODEV; goto err; } @@ -1374,6 +1375,7 @@ static int pistachio_gpio_register(struct pistachio_pinctrl *pctl) irq = irq_of_parse_and_map(child, 0); if (irq < 0) { dev_err(pctl->dev, "No IRQ for bank %u: %d\n", i, irq); + of_node_put(child); ret = irq; goto err; } -- 2.9.5