Skip to content

Commit 760a6ed

Browse files
tititiou36davem330
authored andcommitted
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: efacb56 ("net: stmmac: dwmac-meson: extend phy mode setting") Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 31962c8 commit 760a6ed

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,9 +334,10 @@ static int meson8b_dwmac_probe(struct platform_device *pdev)
334334

335335
dwmac->data = (const struct meson8b_dwmac_data *)
336336
of_device_get_match_data(&pdev->dev);
337-
if (!dwmac->data)
338-
return -EINVAL;
339-
337+
if (!dwmac->data) {
338+
ret = -EINVAL;
339+
goto err_remove_config_dt;
340+
}
340341
res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
341342
dwmac->regs = devm_ioremap_resource(&pdev->dev, res);
342343
if (IS_ERR(dwmac->regs)) {

0 commit comments

Comments
 (0)