ar71xx/ag71xx_mdio_probe: fix a memory leak when probe fails
authorAlexander Couzens <lynxis@fe80.eu>
Sun, 11 Jun 2017 10:49:19 +0000 (12:49 +0200)
committerAlexander Couzens <lynxis@fe80.eu>
Sun, 11 Jun 2017 12:22:44 +0000 (14:22 +0200)
Found-by: Coverity Scan #1330233
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_mdio.c

index 71ae8258b2ef20f7d20ceacec59011ab3babfe23..b63a4b7f9d9f4b997843aa4a91c385ea186d67e2 100644 (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);