Skip to content

Commit

Permalink
drivers/net/phy/mdio-bitbang.c: Call mdiobus_unregister before mdiobu…
Browse files Browse the repository at this point in the history
…s_free

Based on commit b27393a

Calling mdiobus_free without calling mdiobus_unregister causes
BUG_ON(). This patch fixes the issue.

The semantic patch that found this issue(http://coccinelle.lip6.fr/):
// <smpl>
@@
expression E;
@@
  ... when != mdiobus_unregister(E);

+ mdiobus_unregister(E);
  mdiobus_free(E);
// </smpl>

Signed-off-by: Peter Senna Tschudin <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
petersenna authored and davem330 committed Nov 3, 2012
1 parent 57c10b6 commit aa73187
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/phy/mdio-bitbang.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ void free_mdio_bitbang(struct mii_bus *bus)
struct mdiobb_ctrl *ctrl = bus->priv;

module_put(ctrl->ops->owner);
mdiobus_unregister(bus);
mdiobus_free(bus);
}
EXPORT_SYMBOL(free_mdio_bitbang);
Expand Down

0 comments on commit aa73187

Please sign in to comment.