gianfar: Free/iounmap memory after an error in mii bus initialization
Subsystems (2)
PATCH 1/1 gianfar: Free/iounmap memory after an error in mii bus initialization
Recent changes to MII bus initialization code added exit points which didn't free or iounmap the bus before returning.
This was reported as bug #11372
Signed-off-by Andy Fleming <[email protected]>
--- drivers/net/gianfar_mii.c | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-)
drivers/net/gianfar_mii.c +8 -6
@@ -211,19 +211,21 @@ static int gfar_mdio_probe(struct device *dev)gfar_write (&enet_regs->tbipa,0 );for (i =PHY_MAX_ADDR ; i >0 ; i--) {u32 phy_id; -int r; - r =get_phy_id (new_bus, i, &phy_id); -if (r) -return r; + err =get_phy_id (new_bus, i, &phy_id); +if (err) + goto bus_register_fail;if (phy_id ==0xffffffff )break ; }/* The bus is full. We don't support using 31 PHYs, sorry */ -if (i ==0 ) -return -EBUSY ; +if (i ==0 ) { + err = -EBUSY ; + + goto bus_register_fail; + }gfar_write (&enet_regs->tbipa, i);
Signature · 1 line
1.5.4.GIT
Quoted 6 lines · On Thu, 18 Sep 2008 16:37:54 -0500 Andy Fleming <[email protected]> wrote:
Recent changes to MII bus initialization code added exit points which didn't free or iounmap the bus before returning.
This was reported as bug #11372
Signed-off-by Andy Fleming <[email protected]>
administrivia:
- Adding a
Reported-by Daniel Marjamki <[email protected]>
would be nice.
- When referencing a bugzilla report in the changelog I like to use the full URL. Because there are people who periodically troll the mainline commits closing off bugzilla reports. Using the full URL minimises the chance that they will miss something.