Skip to content
Commit 275e2edb authored by Jon Mason's avatar Jon Mason Committed by Greg Kroah-Hartman
Browse files

net: mdio-mux: bcm-iproc: call mdiobus_free() in error path



[ Upstream commit 922c60e8 ]

If an error is encountered in mdio_mux_init(), the error path will call
mdiobus_free().  Since mdiobus_register() has been called prior to
mdio_mux_init(), the bus->state will not be MDIOBUS_UNREGISTERED.  This
causes a BUG_ON() in mdiobus_free().  To correct this issue, add an
error path for mdio_mux_init() which calls mdiobus_unregister() prior to
mdiobus_free().

Signed-off-by: default avatarJon Mason <jon.mason@broadcom.com>
Fixes: 98bc865a ("net: mdio-mux: Add MDIO mux driver for iProc SoCs")
Acked-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ced12308
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment