Skip to content

Commit

Permalink
net: enetc: fix an issue about leak system resources
Browse files Browse the repository at this point in the history
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: 6517798 ("enetc: Make MDIO accessors more generic and export to include/linux/fsl")
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Dejin Zheng authored and David S. Miller committed May 4, 2020
1 parent 40e4730 commit d975cb7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/freescale/enetc/enetc_pci_mdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit d975cb7

Please sign in to comment.