Based on commit b27393aecf66199f5ddad37c302d3e0cfadbe6c0 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>
Unified · Split
| @@ -234,6 +234,7 @@ void free_mdio_bitbang(struct mii_bus *bus) · 233 unmodified lines | |||
| 234 | struct mdiobb_ctrl *ctrl = bus->priv; | 234 | struct mdiobb_ctrl *ctrl = bus->priv; |
| 235 | 235 | ||
| 236 | module_put(ctrl->ops->owner); | 236 | module_put(ctrl->ops->owner); |
| 237 | mdiobus_unregister(bus); | ||
| 237 | mdiobus_free(bus); | 238 | mdiobus_free(bus); |
| 238 | } | 239 | } |
| 239 | EXPORT_SYMBOL(free_mdio_bitbang); | 240 | EXPORT_SYMBOL(free_mdio_bitbang); |