[source] ar71xx/ag71xx_mdio_probe: fix a memory leak when probe fails

LEDE Commits lede-commits at lists.infradead.org
Sun Jun 11 05:27:44 PDT 2017


lynxis pushed a commit to source.git, branch master:
https://git.lede-project.org/64cd4b48e8fb51055a24382564a09877d6d6a08c

commit 64cd4b48e8fb51055a24382564a09877d6d6a08c
Author: Alexander Couzens <lynxis at fe80.eu>
AuthorDate: Sun Jun 11 12:49:19 2017 +0200

    ar71xx/ag71xx_mdio_probe: fix a memory leak when probe fails
    
    Found-by: Coverity Scan #1330233
    Signed-off-by: Alexander Couzens <lynxis at fe80.eu>
---
 .../ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_mdio.c      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_mdio.c b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_mdio.c
index 71ae825..b63a4b7 100644
--- a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_mdio.c
+++ b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_mdio.c
@@ -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);



More information about the lede-commits mailing list