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 <[email protected]>
Cc: Jayachandran Chandrashekaran Nair <[email protected]>

Signed-off-by: Devendra Naga <[email protected]>
---
 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
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel

Reply via email to