Skip to content

Commit 80db65d

Browse files
ISCAS-Vulabnmenon
authored andcommitted
soc: ti: pruss: Fix double free in pruss_clk_mux_setup()
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: ba59c9b ("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>
1 parent c933138 commit 80db65d

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/soc/ti/pruss.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -366,12 +366,10 @@ static int pruss_clk_mux_setup(struct pruss *pruss, struct clk *clk_mux,
366366

367367
ret = devm_add_action_or_reset(dev, pruss_of_free_clk_provider,
368368
clk_mux_np);
369-
if (ret) {
369+
if (ret)
370370
dev_err(dev, "failed to add clkmux free action %d", ret);
371-
goto put_clk_mux_np;
372-
}
373371

374-
return 0;
372+
return ret;
375373

376374
put_clk_mux_np:
377375
of_node_put(clk_mux_np);

0 commit comments

Comments
 (0)