From: Greg Kroah-Hartman <gregkh@linuxfoundation•org>
To: linux-kernel@vger•kernel.org
Cc: "Sasha Levin \(Microsoft\)" <sashal@kernel•org>,
Fabio Estevam <festevam@gmail•com>,
Greg Kroah-Hartman <gregkh@linuxfoundation•org>,
Sascha Hauer <s.hauer@pengutronix•de>,
Russell King <linux@armlinux•org.uk>,
stable@vger•kernel.org, NXP Linux Team <linux-imx@nxp•com>,
Pengutronix Kernel Team <kernel@pengutronix•de>,
Shawn Guo <shawnguo@kernel•org>, Wen Yang <wen.yang99@zte•com.cn>,
linux-arm-kernel@lists•infradead.org,
Lucas Stach <l.stach@pengutronix•de>
Subject: [PATCH 4.19 21/72] ARM: imx51: fix a leaked reference by adding missing of_node_put
Date: Thu, 2 May 2019 17:20:43 +0200 [thread overview]
Message-ID: <20190502143335.077820578@linuxfoundation.org> (raw)
In-Reply-To: <20190502143333.437607839@linuxfoundation.org>
[ Upstream commit 0c17e83fe423467e3ccf0a02f99bd050a73bbeb4 ]
The call to of_get_next_child returns a node pointer with refcount
incremented thus it must be explicitly decremented after the last
usage.
Detected by coccinelle with the following warnings:
./arch/arm/mach-imx/mach-imx51.c:64:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 57, but without a corresponding object release within this function.
Signed-off-by: Wen Yang <wen.yang99@zte•com.cn>
Cc: Russell King <linux@armlinux•org.uk>
Cc: Shawn Guo <shawnguo@kernel•org>
Cc: Sascha Hauer <s.hauer@pengutronix•de>
Cc: Pengutronix Kernel Team <kernel@pengutronix•de>
Cc: Fabio Estevam <festevam@gmail•com>
Cc: NXP Linux Team <linux-imx@nxp•com>
Cc: Lucas Stach <l.stach@pengutronix•de>
Cc: linux-arm-kernel@lists•infradead.org
Cc: linux-kernel@vger•kernel.org
Signed-off-by: Shawn Guo <shawnguo@kernel•org>
Signed-off-by: Sasha Levin (Microsoft) <sashal@kernel•org>
---
arch/arm/mach-imx/mach-imx51.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/mach-imx/mach-imx51.c b/arch/arm/mach-imx/mach-imx51.c
index c7169c2f94c4..08c7892866c2 100644
--- a/arch/arm/mach-imx/mach-imx51.c
+++ b/arch/arm/mach-imx/mach-imx51.c
@@ -59,6 +59,7 @@ static void __init imx51_m4if_setup(void)
return;
m4if_base = of_iomap(np, 0);
+ of_node_put(np);
if (!m4if_base) {
pr_err("Unable to map M4IF registers\n");
return;
--
2.19.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists•infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next parent reply other threads:[~2019-05-02 15:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20190502143333.437607839@linuxfoundation.org>
2019-05-02 15:20 ` Greg Kroah-Hartman [this message]
2019-05-02 15:21 ` [PATCH 4.19 46/72] net: xilinx: fix possible object reference leak Greg Kroah-Hartman
2019-05-03 10:08 ` Pavel Machek
[not found] ` <201905051417486865228@zte.com.cn>
2019-05-06 17:48 ` [PATCH 4.19 46/72] net: xilinx: fix possible object referenceleak Pavel Machek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190502143335.077820578@linuxfoundation.org \
--to=gregkh@linuxfoundation$(echo .)org \
--cc=festevam@gmail$(echo .)com \
--cc=kernel@pengutronix$(echo .)de \
--cc=l.stach@pengutronix$(echo .)de \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
--cc=linux-imx@nxp$(echo .)com \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux@armlinux$(echo .)org.uk \
--cc=s.hauer@pengutronix$(echo .)de \
--cc=sashal@kernel$(echo .)org \
--cc=shawnguo@kernel$(echo .)org \
--cc=stable@vger$(echo .)kernel.org \
--cc=wen.yang99@zte$(echo .)com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox