powerpc/83xx: Add missing of_node_put() after of_device_is_available()
authorJulia Lawall <Julia.Lawall@lip6.fr>
Sat, 23 Feb 2019 13:20:34 +0000 (14:20 +0100)
committerMichael Ellerman <mpe@ellerman.id.au>
Sat, 20 Apr 2019 12:02:27 +0000 (22:02 +1000)
Add an of_node_put() when a tested device node is not available.

Fixes: c026c98739c7e ("powerpc/83xx: Do not configure or probe disabled FSL DR USB controllers")
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/platforms/83xx/usb.c

index 5c31d8292d3bb8c0d65d566c57992ca1064af684..e7c2c3fb011a65650fb507e6aa8665aa05e80a9d 100644 (file)
@@ -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"))) {