mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-05 10:29:37 +00:00
powerpc/mpc5xxx: Add missing fwnode_handle_put()
[ Upstream commitb9bbbf4979
] In mpc5xxx_fwnode_get_bus_frequency(), we should add fwnode_handle_put() when break out of the iteration fwnode_for_each_parent_node() as it will automatically increase and decrease the refcounter. Fixes:de06fba62a
("powerpc/mpc5xxx: Switch mpc5xxx_get_bus_frequency() to use fwnode") Signed-off-by: Liang He <windhl@126.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20230322030423.1855440-1-windhl@126.com Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
ac6d060d97
commit
7b623e1a4b
1 changed files with 3 additions and 1 deletions
|
@ -25,8 +25,10 @@ unsigned long mpc5xxx_fwnode_get_bus_frequency(struct fwnode_handle *fwnode)
|
|||
|
||||
fwnode_for_each_parent_node(fwnode, parent) {
|
||||
ret = fwnode_property_read_u32(parent, "bus-frequency", &bus_freq);
|
||||
if (!ret)
|
||||
if (!ret) {
|
||||
fwnode_handle_put(parent);
|
||||
return bus_freq;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue