Skip to content
Snippets Groups Projects
Commit 1ffbe3a0 authored by Joe Hattori's avatar Joe Hattori Committed by Greg Kroah-Hartman
Browse files

clk: fix an OF node reference leak in of_clk_get_parent_name()


[ Upstream commit 28fa3291 ]

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: 8da411cc ("clk: let of_clk_get_parent_name() fail for invalid clock-indices")
Signed-off-by: default avatarJoe 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: default avatarStephen Boyd <sboyd@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 914ef7d1
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment