Skip to content

Commit

Permalink
usb: host: Fix refcount leak in ehci_hcd_ppc_of_probe
Browse files Browse the repository at this point in the history
of_find_compatible_node() returns a node pointer with refcount
incremented, we should use of_node_put() on it when done.
Add missing of_node_put() to avoid refcount leak.

Fixes: 796bcae ("USB: powerpc: Workaround for the PPC440EPX USBH_23 errata [take 3]")
Acked-by: Alan Stern <[email protected]>
Signed-off-by: Miaoqian Lin <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Yuuoniy authored and gregkh committed Jun 10, 2022
1 parent 3497b9a commit b5c5b13
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/usb/host/ehci-ppc-of.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ static int ehci_hcd_ppc_of_probe(struct platform_device *op)
} else {
ehci->has_amcc_usb23 = 1;
}
of_node_put(np);
}

if (of_get_property(dn, "big-endian", NULL)) {
Expand Down

0 comments on commit b5c5b13

Please sign in to comment.