Skip to content

Commit 9d6d530

Browse files
windhlgregkh
authored andcommitted
usb: renesas: Fix refcount leak bug
In usbhs_rza1_hardware_init(), of_find_node_by_name() will return a node pointer with refcount incremented. We should use of_node_put() when it is not used anymore. Signed-off-by: Liang He <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 40a959d commit 9d6d530

File tree

1 file changed

+4
-0
lines changed
  • drivers/usb/renesas_usbhs

1 file changed

+4
-0
lines changed

drivers/usb/renesas_usbhs/rza.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ static int usbhs_rza1_hardware_init(struct platform_device *pdev)
2323
extal_clk = of_find_node_by_name(NULL, "extal");
2424
of_property_read_u32(usb_x1_clk, "clock-frequency", &freq_usb);
2525
of_property_read_u32(extal_clk, "clock-frequency", &freq_extal);
26+
27+
of_node_put(usb_x1_clk);
28+
of_node_put(extal_clk);
29+
2630
if (freq_usb == 0) {
2731
if (freq_extal == 12000000) {
2832
/* Select 12MHz XTAL */

0 commit comments

Comments
 (0)