net: stmmac: fix leaks in probe
These two error paths should clean up before returning. Fixes: 2bb4b98b60d7 ("net: stmmac: Add Ingenic SoCs MAC support.") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
49b9f431ff
commit
23aa6d5088
@ -273,7 +273,8 @@ static int ingenic_mac_probe(struct platform_device *pdev)
|
||||
mac->tx_delay = tx_delay_ps * 1000;
|
||||
} else {
|
||||
dev_err(&pdev->dev, "Invalid TX clock delay: %dps\n", tx_delay_ps);
|
||||
return -EINVAL;
|
||||
ret = -EINVAL;
|
||||
goto err_remove_config_dt;
|
||||
}
|
||||
}
|
||||
|
||||
@ -283,7 +284,8 @@ static int ingenic_mac_probe(struct platform_device *pdev)
|
||||
mac->rx_delay = rx_delay_ps * 1000;
|
||||
} else {
|
||||
dev_err(&pdev->dev, "Invalid RX clock delay: %dps\n", rx_delay_ps);
|
||||
return -EINVAL;
|
||||
ret = -EINVAL;
|
||||
goto err_remove_config_dt;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user