Skip to contentSkip to conversation

net: enetc: fix an issue about leak system resources

PATCH Applied Dejin Zheng 3 participants 3 messages May 4, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: enetc: fix an issue about leak system resources

the related system resources were not released when enetc_hw_alloc() return error in the enetc_pci_mdio_probe(), add iounmap() for error handling label "err_hw_alloc" to fix it.

Fixes 6517798dd3432a ("enetc: Make MDIO accessors more generic and export to include/linux/fsl")
Cc Andy Shevchenko <[email protected]>
---
 drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c +1 -1
index ebc635f8a4cc..15f37c5b8dc1 100644
@@ -74,8 +74,8 @@ static int enetc_pci_mdio_probe(struct pci_dev *pdev,
 	pci_disable_device(pdev);
 err_pci_enable:
 err_mdiobus_alloc:
-	iounmap(port_regs);
 err_hw_alloc:
+	iounmap(port_regs);
 err_ioremap:
 	return err;
 }
Signature · 1 line
2.25.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Dejin Zheng

the related system resources were not released when enetc_hw_alloc() return error in the enetc_pci_mdio_probe(), add iounmap() for error handling label "err_hw_alloc" to fix it.

Fixes 6517798dd3432a ("enetc: Make MDIO accessors more generic and export to include/linux/fsl")
Cc Andy Shevchenko <[email protected]>

---

Quoted 18 lines
 drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c +1 -2
index ebc635f8a4cc..15f37c5b8dc1 100644
@@ -74,8 +74,8 @@ static int enetc_pci_mdio_probe(struct pci_dev *pdev,
        pci_disable_device(pdev);
 err_pci_enable:
 err_mdiobus_alloc:
-       iounmap(port_regs);
 err_hw_alloc:
+       iounmap(port_regs);
 err_ioremap:
        return err;
 }
--
Quoted 2 lines

2.25.0

Thanks!
-Vladimir

maintainer Applied
#2 lore raw
In reply to Dejin Zheng

From: Dejin Zheng <[email protected]>
Date: Mon, 4 May 2020 20:01:27 +0800

Quoted 7 lines

the related system resources were not released when enetc_hw_alloc() return error in the enetc_pci_mdio_probe(), add iounmap() for error handling label "err_hw_alloc" to fix it.

Fixes 6517798dd3432a ("enetc: Make MDIO accessors more generic and export to include/linux/fsl")
Cc Andy Shevchenko <[email protected]>

Applied, thank you.