Skip to content

Commit

Permalink
powerpc/83xx: Add missing of_node_put() after of_device_is_available()
Browse files Browse the repository at this point in the history
Add an of_node_put() when a tested device node is not available.

Fixes: c026c98 ("powerpc/83xx: Do not configure or probe disabled FSL DR USB controllers")
Signed-off-by: Julia Lawall <[email protected]>
Reviewed-by: Mukesh Ojha <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
  • Loading branch information
JuliaLawall authored and mpe committed Apr 20, 2019
1 parent 0235854 commit 4df2cb6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion arch/powerpc/platforms/83xx/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,10 @@ int mpc837x_usb_cfg(void)
int ret = 0;

np = of_find_compatible_node(NULL, NULL, "fsl-usb2-dr");
if (!np || !of_device_is_available(np))
if (!np || !of_device_is_available(np)) {
of_node_put(np);
return -ENODEV;
}
prop = of_get_property(np, "phy_type", NULL);

if (!prop || (strcmp(prop, "ulpi") && strcmp(prop, "serial"))) {
Expand Down

0 comments on commit 4df2cb6

Please sign in to comment.