Skip to content

Commit

Permalink
net: stmmac: fix leaks in probe
Browse files Browse the repository at this point in the history
These two error paths should clean up before returning.

Fixes: 2bb4b98 ("net: stmmac: Add Ingenic SoCs MAC support.")
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Dan Carpenter authored and davem330 committed Jul 13, 2022
1 parent 49b9f43 commit 23aa6d5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand All @@ -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;
}
}

Expand Down

0 comments on commit 23aa6d5

Please sign in to comment.