Commit 28fa329
clk: fix an OF node reference leak in of_clk_get_parent_name()
Current implementation of of_clk_get_parent_name() leaks an OF node
reference on error path. Add a of_node_put() call before returning an
error.
This bug was found by an experimental static analysis tool that I am
developing.
Fixes: 8da411c ("clk: let of_clk_get_parent_name() fail for invalid clock-indices")
Signed-off-by: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Link: https://lore.kernel.org/r/20241210130913.3615205-1-joe@pf.is.s.u-tokyo.ac.jp
Signed-off-by: Stephen Boyd <sboyd@kernel.org>1 parent e5ca5d7 commit 28fa329
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5385 | 5385 | | |
5386 | 5386 | | |
5387 | 5387 | | |
5388 | | - | |
| 5388 | + | |
| 5389 | + | |
5389 | 5390 | | |
| 5391 | + | |
5390 | 5392 | | |
5391 | 5393 | | |
5392 | 5394 | | |
| |||
0 commit comments