[PATCH 5/5] staging: netlogic: free up irq and unregister mdio bus if xlr_mii_probe fail

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


the irq pointer and mdio bus should be freed/unregistered in error path, as
they are previously allocated/have reference to other subsystems

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 | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/netlogic/xlr_net.c b/drivers/staging/netlogic/xlr_net.c
index 8aa6604..ea9b729 100644
--- a/drivers/staging/netlogic/xlr_net.c
+++ b/drivers/staging/netlogic/xlr_net.c
@@ -905,6 +905,8 @@ static int xlr_setup_mdio(struct xlr_net_priv *priv,
 	pr_info("Registerd mdio bus id : %s\n", priv->mii_bus->id);
 	err = xlr_mii_probe(priv);
 	if (err) {
+		kfree(priv->mii_bus->irq);
+		mdiobus_unregister(priv->mii_bus);
 		mdiobus_free(priv->mii_bus);
 		return err;
 	}
-- 
1.8.1.4




More information about the devel mailing list