Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3134651ybi; Thu, 18 Jul 2019 21:42:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqx4HcHDO/76VPdZJLPVf7bQoh/I3s3zmKcNCvUO8RGqTIKQsx8OOzAmdioTi3eS0oVMjHbZ X-Received: by 2002:a17:90a:db42:: with SMTP id u2mr55615071pjx.48.1563511353291; Thu, 18 Jul 2019 21:42:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563511353; cv=none; d=google.com; s=arc-20160816; b=F2oT/8GQh+UPT3L0ecDdBMiUj/+5vSXQAX/Ji37Mc1sigertKvTXsYEQio0NCJWeU+ hcFJnA7t8zvh5AXPTZq4Zt8To+t81Kdwup8ItmHwPavsoyqdeDvU0uolZjaz++sDYKCt UzGWyMpw9YyZIevFy5li+ieE0P3rT4zwJyl7BcZ7gQrz00AmwsktZ6PBiE/jjz2vYkeC YVVU8f6uMnz+tM9tOqsxKsQg6osZO+5flzt8TAf+Us34lCDOYuSZMF0qNbohTlTcv8Ii t2HKNyZqtE2MsDyelWQKsG9RozjMaiTxDrm2eAFG8vOr6aGINIRlyHYFEFNJ8rmRXn4X z/7g== 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 :dkim-signature; bh=qFT4sSI8j7V0F2byOXGxxnts48FbqPi5b2nUu4Ob164=; b=LRStZRZDj51JlXyJusRv4UGyWNA22AIc59Lr2iaYO5KSigLnIzJenHR6Z1f9qT+7N0 2Eb7X232Avc2ZitFwMll11L/LWK23amTCOqabPqR1TzWUkCGyiuk4qJF3iRrABudcupG WAmExvhfe58jVJdlGqj8QeaWn/6gtkb8cWqNztUD6mRgqUHhPTi6Hf5c4fg/MV1pPcqA 9nS9jI0YcI5Mrvl0GDt8/mUSW22gjzx9fEgBobGcqWAvx3KRzIp1p3SaOcqwb51ZkDop VgR4QX6qVtH6RCqQD7EeJXCkD0RuXkTX8u5bHkMszYeNGjl9DGpUSopFpCPy62ZtqWMT lQ7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cIqahlJH; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d38si919546pla.287.2019.07.18.21.42.17; Thu, 18 Jul 2019 21:42: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; dkim=pass header.i=@kernel.org header.s=default header.b=cIqahlJH; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727130AbfGSD5O (ORCPT + 99 others); Thu, 18 Jul 2019 23:57:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:56498 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727056AbfGSD5L (ORCPT ); Thu, 18 Jul 2019 23:57:11 -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 0566A21852; Fri, 19 Jul 2019 03:57:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563508630; bh=n4tzgIJGYk/RW0+7lrFTK5XGxFRsx5zPbIlfOt2bBmQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cIqahlJH1vg7HGfq9TGHiOdBxjSey8lsN+MJ+znsfO95csp6NsjLVbU9xwTLdGL1q yVRYLWYGlFLwhNRHrLqAVWbdlNrRzLnrqmqk0vDbyBH36dEnn/YxP8v6jKrSvCtJtZ MFtyz/nuy/x1DLZX90eIB33FpxT+gVteneC3xTMs= 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.2 012/171] pinctrl: rockchip: fix leaked of_node references Date: Thu, 18 Jul 2019 23:54:03 -0400 Message-Id: <20190719035643.14300-12-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190719035643.14300-1-sashal@kernel.org> References: <20190719035643.14300-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 807a3263d849..62a622159006 100644 --- a/drivers/pinctrl/pinctrl-rockchip.c +++ b/drivers/pinctrl/pinctrl-rockchip.c @@ -3204,6 +3204,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