* [PATCH] fsi: master-aspeed: Fix of_node reference leak in fsi_master_aspeed_probe()
@ 2026-09-16 9:39 Wentao Liang
2026-09-16 9:44 ` Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: Wentao Liang @ 2026-09-16 9:39 UTC (permalink / raw)
To: alistair
Cc: andrew, eajames, gregkh, joel, linux-arm-kernel, linux-aspeed,
linux-fsi, linux-kernel, ninad, Wentao Liang, stable
In fsi_master_aspeed_probe(), a reference to the device tree node is
taken with of_node_get() and stored in master.dev.of_node. If
fsi_master_register() fails, the error path frees the master without
putting that reference, leaking it.
Put the device node reference before returning on the error path.
of_node_put() tolerates a NULL node, so the earlier err_release path
via opb_readl() is unaffected.
Fixes: 606397d67f41 ("fsi: Add ast2600 master driver")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
drivers/fsi/fsi-master-aspeed.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/fsi/fsi-master-aspeed.c b/drivers/fsi/fsi-master-aspeed.c
index aa1380cdff33..7c7f30c2b8e6 100644
--- a/drivers/fsi/fsi-master-aspeed.c
+++ b/drivers/fsi/fsi-master-aspeed.c
@@ -640,6 +640,7 @@ static int fsi_master_aspeed_probe(struct platform_device *pdev)
return 0;
err_release:
+ of_node_put(aspeed->master.dev.of_node);
clk_disable_unprepare(aspeed->clk);
err_free_aspeed:
kfree(aspeed);
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] fsi: master-aspeed: Fix of_node reference leak in fsi_master_aspeed_probe()
2026-09-16 9:39 [PATCH] fsi: master-aspeed: Fix of_node reference leak in fsi_master_aspeed_probe() Wentao Liang
@ 2026-09-16 9:44 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2026-09-16 9:44 UTC (permalink / raw)
To: Wentao Liang
Cc: alistair, andrew, eajames, joel, linux-arm-kernel, linux-aspeed,
linux-fsi, linux-kernel, ninad, stable
On Wed, Sep 16, 2026 at 09:39:14AM +0000, Wentao Liang wrote:
> In fsi_master_aspeed_probe(), a reference to the device tree node is
> taken with of_node_get() and stored in master.dev.of_node. If
> fsi_master_register() fails, the error path frees the master without
> putting that reference, leaking it.
>
> Put the device node reference before returning on the error path.
> of_node_put() tolerates a NULL node, so the earlier err_release path
> via opb_readl() is unaffected.
>
> Fixes: 606397d67f41 ("fsi: Add ast2600 master driver")
> Cc: stable@vger.kernel.org
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
> ---
> drivers/fsi/fsi-master-aspeed.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/fsi/fsi-master-aspeed.c b/drivers/fsi/fsi-master-aspeed.c
> index aa1380cdff33..7c7f30c2b8e6 100644
> --- a/drivers/fsi/fsi-master-aspeed.c
> +++ b/drivers/fsi/fsi-master-aspeed.c
> @@ -640,6 +640,7 @@ static int fsi_master_aspeed_probe(struct platform_device *pdev)
> return 0;
>
> err_release:
> + of_node_put(aspeed->master.dev.of_node);
> clk_disable_unprepare(aspeed->clk);
> err_free_aspeed:
> kfree(aspeed);
> --
> 2.34.1
>
>
did you forget an Assisted-by: tag?
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-16 10:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-16 9:39 [PATCH] fsi: master-aspeed: Fix of_node reference leak in fsi_master_aspeed_probe() Wentao Liang
2026-09-16 9:44 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox