diff options
author | Alexey Khoroshilov <khoroshilov@ispras.ru> | 2019-02-15 16:20:54 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-02-17 18:44:26 -0500 |
commit | e928b5d6b75e239feb9c6d5488974b6646a0ebc8 (patch) | |
tree | 0bffd3906507b4886430273ccf540ac352c2d996 | |
parent | 97dc47a1308a3af46a09b1546cfb869f2e382a81 (diff) |
net: mv643xx_eth: disable clk on error path in mv643xx_eth_shared_probe()
If mv643xx_eth_shared_of_probe() fails, mv643xx_eth_shared_probe()
leaves clk enabled.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/marvell/mv643xx_eth.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c index 2f427271a793..292a668ce88e 100644 --- a/drivers/net/ethernet/marvell/mv643xx_eth.c +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c | |||
@@ -2879,7 +2879,7 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev) | |||
2879 | 2879 | ||
2880 | ret = mv643xx_eth_shared_of_probe(pdev); | 2880 | ret = mv643xx_eth_shared_of_probe(pdev); |
2881 | if (ret) | 2881 | if (ret) |
2882 | return ret; | 2882 | goto err_put_clk; |
2883 | pd = dev_get_platdata(&pdev->dev); | 2883 | pd = dev_get_platdata(&pdev->dev); |
2884 | 2884 | ||
2885 | msp->tx_csum_limit = (pd != NULL && pd->tx_csum_limit) ? | 2885 | msp->tx_csum_limit = (pd != NULL && pd->tx_csum_limit) ? |
@@ -2887,6 +2887,11 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev) | |||
2887 | infer_hw_params(msp); | 2887 | infer_hw_params(msp); |
2888 | 2888 | ||
2889 | return 0; | 2889 | return 0; |
2890 | |||
2891 | err_put_clk: | ||
2892 | if (!IS_ERR(msp->clk)) | ||
2893 | clk_disable_unprepare(msp->clk); | ||
2894 | return ret; | ||
2890 | } | 2895 | } |
2891 | 2896 | ||
2892 | static int mv643xx_eth_shared_remove(struct platform_device *pdev) | 2897 | static int mv643xx_eth_shared_remove(struct platform_device *pdev) |