Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp179987yba; Fri, 12 Apr 2019 01:09:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqxulO7KPFytLPU5fmqLu6DRcrwpAdomQj6vK2xH4KXzL2pa3D+bNkMejmcleAhgyfQPx6TD X-Received: by 2002:a65:4802:: with SMTP id h2mr48287762pgs.98.1555056573890; Fri, 12 Apr 2019 01:09:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555056573; cv=none; d=google.com; s=arc-20160816; b=RODgzhpOrvKnq4n7i9VpIzQRSj420Cmwltm+ipoZMFBvT4tDbqtJjtzBaVKZVg+Jva njgnYVEmudIOp9B0n/Dot6CpnjydGxijgN+nJooqu6tQQR94uYDbY/uo3FARZPsE7F8h RW0VNtcmbEd+9VY6CZDKbmG1YNWaKyFIN/iAEfiWQcsX36w4NjgpVNxyBFYnkpSlIuqV Eo3o/46xocNz/lScTTo1azmaa+NF3K/v/tkyTSWKC3F6KdepGsyOHKtUAvEjOPXkodn3 qT2S6z3DsGJ2d58RJ7anN8OEYxTJa07LpJcwI6f7J2TiFdQmNdXryCgJDz77mUFj7gHj 3RNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=R1buK6KAdlzVPyyifbW0uyjqZjMFfW/qYb0H4hWKSKs=; b=eJ/yh+J3JD8GVrIMeF2M0uQP78bxevdzMD+UR0VZfSJ0fSrfbseh1EoDHz4vIbvKK5 5X/iL+cKlb3OT+UHTfo/aiFaA4yGtiRNw0C9IlKhCh27zdyGsNm7t0PNzNNOFUhDWGFJ vAVs8hLAMIVrWRd7LVPQZCYtS+6iHdPlZi8AM332q+DeuvOCj7p1Eoqe54tBo7o57dEv vjyPNHid9ZlEcv1WOFffpz77+i12vBAEV/ruvD7UHy/KswJnMJXH5ZidIRB2CGyi6R1q 3/qu3syV9+wjBXbtn2rvKulL9z/WBz0mwlBjLmls/DbVioJobRS93C5InM0R3xoHtmV8 dlHQ== 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 62si20185074pla.124.2019.04.12.01.09.17; Fri, 12 Apr 2019 01:09:33 -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 S1727241AbfDLIIf (ORCPT + 99 others); Fri, 12 Apr 2019 04:08:35 -0400 Received: from gloria.sntech.de ([185.11.138.130]:36400 "EHLO gloria.sntech.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725973AbfDLIIf (ORCPT ); Fri, 12 Apr 2019 04:08:35 -0400 Received: from ip5f5a6320.dynamic.kabel-deutschland.de ([95.90.99.32] helo=diego.localnet) by gloria.sntech.de with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hErEY-0003xN-1G; Fri, 12 Apr 2019 10:08:26 +0200 From: Heiko =?ISO-8859-1?Q?St=FCbner?= To: Wen Yang Cc: linux-kernel@vger.kernel.org, wang.yi59@zte.com.cn, Linus Walleij , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org Subject: Re: [PATCH 2/5] pinctrl: rockchip: fix leaked of_node references Date: Fri, 12 Apr 2019 10:08:25 +0200 Message-ID: <4822039.BKTqNpLmcE@diego> In-Reply-To: <1555048943-39589-3-git-send-email-wen.yang99@zte.com.cn> References: <1555048943-39589-1-git-send-email-wen.yang99@zte.com.cn> <1555048943-39589-3-git-send-email-wen.yang99@zte.com.cn> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Am Freitag, 12. April 2019, 08:02:20 CEST schrieb Wen Yang: > The call to of_parse_phandle 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-rockchip.c:3221:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 3196, but without a corresponding object release within this function. > ./drivers/pinctrl/pinctrl-rockchip.c:3223:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 3196, but without a corresponding object release within this function. > > Signed-off-by: Wen Yang > Cc: Linus Walleij > Cc: Heiko Stuebner > Cc: linux-gpio@vger.kernel.org > Cc: linux-arm-kernel@lists.infradead.org > Cc: linux-rockchip@lists.infradead.org > Cc: linux-kernel@vger.kernel.org > --- > drivers/pinctrl/pinctrl-rockchip.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c > index 16bf21b..e22d387 100644 > --- a/drivers/pinctrl/pinctrl-rockchip.c > +++ b/drivers/pinctrl/pinctrl-rockchip.c > @@ -3195,6 +3195,7 @@ static int rockchip_get_bank_data(struct rockchip_pin_bank *bank, > > node = of_parse_phandle(bank->of_node->parent, > "rockchip,pmu", 0); > + of_node_put(node); > if (!node) { > if (of_address_to_resource(bank->of_node, 1, &res)) { > dev_err(info->dev, "cannot find IO resource for bank\n"); > hmm, the conditional does still use the node pointer, so the of_node_put should probably be below the whole if clause? Heiko