Skip to content

Commit

Permalink
net: stmmac: dwmac-meson8b: Fix an error handling path in 'meson8b_dw…
Browse files Browse the repository at this point in the history
…mac_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: efacb56 ("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>
  • Loading branch information
tititiou36 authored and davem330 committed Jun 12, 2018
1 parent 31962c8 commit 760a6ed
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,10 @@ static int meson8b_dwmac_probe(struct platform_device *pdev)

dwmac->data = (const struct meson8b_dwmac_data *)
of_device_get_match_data(&pdev->dev);
if (!dwmac->data)
return -EINVAL;

if (!dwmac->data) {
ret = -EINVAL;
goto err_remove_config_dt;
}
res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
dwmac->regs = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(dwmac->regs)) {
Expand Down

0 comments on commit 760a6ed

Please sign in to comment.