Skip to content

Commit 40a959d

Browse files
windhlgregkh
authored andcommitted
usb: host: ohci-ppc-of: Fix refcount leak bug
In ohci_hcd_ppc_of_probe(), of_find_compatible_node() will return a node pointer with refcount incremented. We should use of_node_put() when it is not used anymore. Acked-by: Alan Stern <[email protected]> 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 a37599e commit 40a959d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/usb/host/ohci-ppc-of.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ static int ohci_hcd_ppc_of_probe(struct platform_device *op)
166166
release_mem_region(res.start, 0x4);
167167
} else
168168
pr_debug("%s: cannot get ehci offset from fdt\n", __FILE__);
169+
of_node_put(np);
169170
}
170171

171172
irq_dispose_mapping(irq);

0 commit comments

Comments
 (0)