mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-11 11:09:13 +00:00
net: mv643xx_eth: disable clk on error path in mv643xx_eth_shared_probe()
[ Upstream commit e928b5d6b7
]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
a139d6a318
commit
3a53213423
1 changed files with 6 additions and 1 deletions
|
@ -2886,7 +2886,7 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev)
|
|||
|
||||
ret = mv643xx_eth_shared_of_probe(pdev);
|
||||
if (ret)
|
||||
return ret;
|
||||
goto err_put_clk;
|
||||
pd = dev_get_platdata(&pdev->dev);
|
||||
|
||||
msp->tx_csum_limit = (pd != NULL && pd->tx_csum_limit) ?
|
||||
|
@ -2894,6 +2894,11 @@ static int mv643xx_eth_shared_probe(struct platform_device *pdev)
|
|||
infer_hw_params(msp);
|
||||
|
||||
return 0;
|
||||
|
||||
err_put_clk:
|
||||
if (!IS_ERR(msp->clk))
|
||||
clk_disable_unprepare(msp->clk);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int mv643xx_eth_shared_remove(struct platform_device *pdev)
|
||||
|
|
Loading…
Reference in a new issue