Skip to contentSkip to conversation

Patch "net: mdio-mux: bcm-iproc: call mdiobus_free() in error path" has been added to the 4.11-stable tree

PATCH [email protected] 1 participant 1 message May 11, 2017

Subsystems (4)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

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

to the 4.11-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
net-mdio-mux-bcm-iproc-call-mdiobus_free-in-error-path.patch
and it can be found in the queue-4.11 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Thu May 11 11:03:15 CEST 2017

From: Jon Mason <[email protected]>
Date: Mon, 8 May 2017 17:48:35 -0400
Subject: net: mdio-mux: bcm-iproc: call mdiobus_free() in error path

From: Jon Mason <[email protected]>

[ Upstream commit 922c60e89d52730050c6ccca218bff40cc8bcd8e ]

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().

Fixes 98bc865a1ec8 ("net: mdio-mux: Add MDIO mux driver for iProc SoCs")
---
 drivers/net/phy/mdio-mux-bcm-iproc.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/phy/mdio-mux-bcm-iproc.c +4 -1
@@ -203,11 +203,14 @@ static int mdio_mux_iproc_probe(struct p
 			   &md->mux_handle, md, md->mii_bus);
 	if (rc) {
 		dev_info(md->dev, "mdiomux initialization failed\n");
-		goto out;
+		goto out_register;
 	}
 
 	dev_info(md->dev, "iProc mdiomux registered\n");
 	return 0;
+
+out_register:
+	mdiobus_unregister(bus);
 out:
 	mdiobus_free(bus);
 	return rc;

Patches currently in stable-queue which might be from [email protected] are

queue-4.11/net-mdio-mux-bcm-iproc-call-mdiobus_free-in-error-path.patch