]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
firmware: imx-scu: fix OF node leak in .probe()
authorJoe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Tue, 24 Dec 2024 03:34:56 +0000 (12:34 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:30:52 +0000 (14:30 +0200)
[ Upstream commit fbf10b86f6057cf79300720da4ea4b77e6708b0d ]

imx_scu_probe() calls of_parse_phandle_with_args(), but does not
release the OF node reference obtained by it. Add a of_node_put() call
after done with the node.

Fixes: f25a066d1a07 ("firmware: imx-scu: Support one TX and one RX")
Signed-off-by: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/firmware/imx/imx-scu.c

index dca79caccd01c15ff5761423e24a247a858abf7a..fa25c082109acce8bf5287eab0e2c71534d0bc18 100644 (file)
@@ -279,6 +279,7 @@ static int imx_scu_probe(struct platform_device *pdev)
                return ret;
 
        sc_ipc->fast_ipc = of_device_is_compatible(args.np, "fsl,imx8-mu-scu");
+       of_node_put(args.np);
 
        num_channel = sc_ipc->fast_ipc ? 2 : SCU_MU_CHAN_NUM;
        for (i = 0; i < num_channel; i++) {