OSDN Git Service

net: ethernet: stmmac: dwmac-meson8b: fix probe error path
authorJohan Hovold <johan@kernel.org>
Wed, 30 Nov 2016 14:29:53 +0000 (15:29 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 2 Dec 2016 15:42:46 +0000 (10:42 -0500)
Make sure to disable clocks before returning on late probe errors.

Fixes: 566e82516253 ("net: stmmac: add a glue driver for the Amlogic
Meson 8b / GXBB DWMAC")
Signed-off-by: Johan Hovold <johan@kernel.org>
Acked-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c

index 250e4ce..45e7aaf 100644 (file)
@@ -289,7 +289,16 @@ static int meson8b_dwmac_probe(struct platform_device *pdev)
 
        plat_dat->bsp_priv = dwmac;
 
-       return stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
+       ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
+       if (ret)
+               goto err_clk_disable;
+
+       return 0;
+
+err_clk_disable:
+       clk_disable_unprepare(dwmac->m25_div_clk);
+
+       return ret;
 }
 
 static int meson8b_dwmac_remove(struct platform_device *pdev)