Skip to content

Commit b9bbbf4

Browse files
windhlmpe
authored andcommitted
powerpc/mpc5xxx: Add missing fwnode_handle_put()
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: de06fba ("powerpc/mpc5xxx: Switch mpc5xxx_get_bus_frequency() to use fwnode") Signed-off-by: Liang He <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://msgid.link/[email protected]
1 parent cdebfd2 commit b9bbbf4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

arch/powerpc/sysdev/mpc5xxx_clocks.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ unsigned long mpc5xxx_fwnode_get_bus_frequency(struct fwnode_handle *fwnode)
2525

2626
fwnode_for_each_parent_node(fwnode, parent) {
2727
ret = fwnode_property_read_u32(parent, "bus-frequency", &bus_freq);
28-
if (!ret)
28+
if (!ret) {
29+
fwnode_handle_put(parent);
2930
return bus_freq;
31+
}
3032
}
3133

3234
return 0;

0 commit comments

Comments
 (0)