[PATCH 4/5] staging: netlogic: free up the irq pointer if mdio_register fail

Devendra Naga devendra.aaru at gmail.com
Sun Jun 2 17:25:19 UTC 2013

mdio register can fail, and unregisters the mdio bus, but forgets
freeing up the irq variable which is allocated before

Cc: Ganesan Ramalingam <ganesanr at broadcom.com>
Cc: Jayachandran Chandrashekaran Nair <jchandra at broadcom.com>

Signed-off-by: Devendra Naga <devendra.aaru at gmail.com>
 drivers/staging/netlogic/xlr_net.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/netlogic/xlr_net.c b/drivers/staging/netlogic/xlr_net.c
index a228b9d..8aa6604 100644
--- a/drivers/staging/netlogic/xlr_net.c
+++ b/drivers/staging/netlogic/xlr_net.c
@@ -896,6 +896,7 @@ static int xlr_setup_mdio(struct xlr_net_priv *priv,
 	err = mdiobus_register(priv->mii_bus);
 	if (err) {
+		kfree(priv->mii_bus->irq);
 		pr_err("mdio bus registration failed\n");
 		return err;

More information about the devel mailing list