[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201126191146.8753-4-prabhakar.mahadev-lad.rj@bp.renesas.com>
Date: Thu, 26 Nov 2020 19:11:44 +0000
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>
To: Sergei Shtylyov <sergei.shtylyov@...il.com>,
Krzysztof Kozlowski <krzk@...nel.org>,
Philipp Zabel <p.zabel@...gutronix.de>,
Jiri Kosina <trivial@...nel.org>,
Mark Brown <broonie@...nel.org>,
linux-renesas-soc@...r.kernel.org, Pavel Machek <pavel@...x.de>,
Geert Uytterhoeven <geert+renesas@...der.be>
Cc: linux-kernel@...r.kernel.org,
Prabhakar <prabhakar.csengg@...il.com>,
Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>,
stable@...r.kernel.org
Subject: [PATCH v2 3/5] memory: renesas-rpc-if: Fix a reference leak in rpcif_probe()
Release the node reference by calling of_node_put(flash) in the probe.
Fixes: ca7d8b980b67f ("memory: add Renesas RPC-IF driver")
Reported-by: Pavel Machek <pavel@...x.de>
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>
Cc: stable@...r.kernel.org
Reviewed-by: Sergei Shtylyov <sergei.shtylyov@...il.com>
---
drivers/memory/renesas-rpc-if.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/memory/renesas-rpc-if.c b/drivers/memory/renesas-rpc-if.c
index a8d0ba368625..da0fdb4c7595 100644
--- a/drivers/memory/renesas-rpc-if.c
+++ b/drivers/memory/renesas-rpc-if.c
@@ -561,9 +561,11 @@ static int rpcif_probe(struct platform_device *pdev)
} else if (of_device_is_compatible(flash, "cfi-flash")) {
name = "rpc-if-hyperflash";
} else {
+ of_node_put(flash);
dev_warn(&pdev->dev, "unknown flash type\n");
return -ENODEV;
}
+ of_node_put(flash);
vdev = platform_device_alloc(name, pdev->id);
if (!vdev)
--
2.25.1
Powered by blists - more mailing lists