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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxx>
Cc: Jayachandran Chandrashekaran Nair <jchandra@xxxxxxxxxxxx>

Signed-off-by: Devendra Naga <devendra.aaru@xxxxxxxxx>
---
 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

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux