ar71xx/ag71xx_mdio_probe: fix a memory leak when probe fails

Found-by: Coverity Scan #1330233
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
This commit is contained in:
Alexander Couzens 2017-06-11 12:49:19 +02:00
parent d18cb142d5
commit 64cd4b48e8

View File

@ -234,7 +234,7 @@ static int ag71xx_mdio_probe(struct platform_device *pdev)
if (!res) {
dev_err(&pdev->dev, "no iomem resource found\n");
err = -ENXIO;
goto err_out;
goto err_free_mdio;
}
am->mdio_base = ioremap_nocache(res->start, res->end - res->start + 1);