net: stmmac: dwmac-meson8b: Fix an error handling path in 'meson8b_dwmac_probe()'

If 'of_device_get_match_data()' fails, we need to release some resources as
done in the other error handling path of this function.

Fixes: efacb568c9 ("net: stmmac: dwmac-meson: extend phy mode setting")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Christophe JAILLET 2018-06-11 19:52:27 +02:00 committed by David S. Miller
parent 31962c8c78
commit 760a6ed6b6

View File

@ -334,9 +334,10 @@ static int meson8b_dwmac_probe(struct platform_device *pdev)
dwmac->data = (const struct meson8b_dwmac_data *) dwmac->data = (const struct meson8b_dwmac_data *)
of_device_get_match_data(&pdev->dev); of_device_get_match_data(&pdev->dev);
if (!dwmac->data) if (!dwmac->data) {
return -EINVAL; ret = -EINVAL;
goto err_remove_config_dt;
}
res = platform_get_resource(pdev, IORESOURCE_MEM, 1); res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
dwmac->regs = devm_ioremap_resource(&pdev->dev, res); dwmac->regs = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(dwmac->regs)) { if (IS_ERR(dwmac->regs)) {