From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB7FCC76188 for ; Fri, 19 Jul 2019 04:33:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8C37C2173B for ; Fri, 19 Jul 2019 04:33:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563510809; bh=2cRbhK4sG1EWt8bmvhrSC8rBHoz0j9kKf4MkuRJTtwQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=gkp8tebGjXsB4HEW/4+xyQGNtilWTOnFumzwm/d9mraeSI8XnZVx+tnrPSSOk2k7k yrx5w1sRcl0U37gaINhB6rnQNFPi3coTXpsNNi/5cIj6n1CVZG45G4gqmwDaRQ88u2 utBtN9S2j0lthaw6TSNaAGbemhQqoQ4NjFiGrWs0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731106AbfGSEd2 (ORCPT ); Fri, 19 Jul 2019 00:33:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:35078 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730255AbfGSEDF (ORCPT ); Fri, 19 Jul 2019 00:03:05 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2E46C21850; Fri, 19 Jul 2019 04:03:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563508985; bh=2cRbhK4sG1EWt8bmvhrSC8rBHoz0j9kKf4MkuRJTtwQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bUt/uRtu0bPcWwh0XOOAE21/m492fYeuMjEp7yOkpJEOTxoHAJmkjNCSKvJlYuN8H KODegTa0eyrtklxVMTJEedm4AJ8blZu2mDDC4wsJb1oMiU+Bs17TBYTTjruxm851cZ gzbDlkbtUVKjV57PfpvizGo88Dn4BOEP+nnHrmKU= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Wen Yang , Linus Walleij , Heiko Stuebner , linux-gpio@vger.kernel.org, linux-rockchip@lists.infradead.org, Sasha Levin Subject: [PATCH AUTOSEL 5.1 010/141] pinctrl: rockchip: fix leaked of_node references Date: Fri, 19 Jul 2019 00:00:35 -0400 Message-Id: <20190719040246.15945-10-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190719040246.15945-1-sashal@kernel.org> References: <20190719040246.15945-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org From: Wen Yang [ Upstream commit 3c89c70634bb0b6f48512de873e7a45c7e1fbaa5 ] 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-rockchip@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Linus Walleij Signed-off-by: Sasha Levin --- 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 16bf21bf69a2..64363363fe27 100644 --- a/drivers/pinctrl/pinctrl-rockchip.c +++ b/drivers/pinctrl/pinctrl-rockchip.c @@ -3212,6 +3212,7 @@ static int rockchip_get_bank_data(struct rockchip_pin_bank *bank, base, &rockchip_regmap_config); } + of_node_put(node); } bank->irq = irq_of_parse_and_map(bank->of_node, 0); -- 2.20.1