Similarly as it is done in ci13xxx_imx_remove(), only calls of_node_put if
data->phy_np is not NULL.

Signed-off-by: Fabio Estevam <fabio.este...@freescale.com>
---
 drivers/usb/chipidea/ci13xxx_imx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/chipidea/ci13xxx_imx.c 
b/drivers/usb/chipidea/ci13xxx_imx.c
index 1661cac..8b2d6cf 100644
--- a/drivers/usb/chipidea/ci13xxx_imx.c
+++ b/drivers/usb/chipidea/ci13xxx_imx.c
@@ -239,7 +239,8 @@ static int ci13xxx_imx_remove(struct platform_device *pdev)
                module_put(data->phy->dev->driver->owner);
        }
 
-       of_node_put(data->phy_np);
+       if (data->phy_np)
+               of_node_put(data->phy_np);
 
        clk_disable_unprepare(data->clk);
 
-- 
1.8.1.2


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to