diff options
| author | Wentao Liang <vulab@iscas.ac.cn> | 2026-01-13 01:47:16 +0000 |
|---|---|---|
| committer | Sasha Levin <sashal@kernel.org> | 2026-03-04 07:20:16 -0500 |
| commit | dbda01bf2dfe5af33163e1e5fca1b82b619c2803 (patch) | |
| tree | c4a477fe2fbae120301ade6b1740058259a41336 | |
| parent | c97c21d342838b2a7787b0f1d6ad417e85c906f6 (diff) | |
soc: ti: pruss: Fix double free in pruss_clk_mux_setup()
[ Upstream commit 80db65d4acfb9ff12d00172aed39ea8b98261aad ]
In the pruss_clk_mux_setup(), the devm_add_action_or_reset() indirectly
calls pruss_of_free_clk_provider(), which calls of_node_put(clk_mux_np)
on the error path. However, after the devm_add_action_or_reset()
returns, the of_node_put(clk_mux_np) is called again, causing a double
free.
Fix by returning directly, to avoid the duplicate of_node_put().
Fixes: ba59c9b43c86 ("soc: ti: pruss: support CORECLK_MUX and IEPCLK_MUX")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Link: https://patch.msgid.link/20260113014716.2464741-1-vulab@iscas.ac.cn
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
| -rw-r--r-- | drivers/soc/ti/pruss.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/soc/ti/pruss.c b/drivers/soc/ti/pruss.c index bf2ba4c8595b..faf3f2c75c09 100644 --- a/drivers/soc/ti/pruss.c +++ b/drivers/soc/ti/pruss.c @@ -106,12 +106,10 @@ static int pruss_clk_mux_setup(struct pruss *pruss, struct clk *clk_mux, ret = devm_add_action_or_reset(dev, pruss_of_free_clk_provider, clk_mux_np); - if (ret) { + if (ret) dev_err(dev, "failed to add clkmux free action %d", ret); - goto put_clk_mux_np; - } - return 0; + return ret; put_clk_mux_np: of_node_put(clk_mux_np); |
