Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6a8121572e2f2d188f04673bfa460ccfcedeb008
Commit:     6a8121572e2f2d188f04673bfa460ccfcedeb008
Parent:     51d84f501684db22f5fcc30821cbbde2a0a2f264
Author:     Marcelo Tosatti <[EMAIL PROTECTED]>
AuthorDate: Fri May 25 12:09:13 2007 -0400
Committer:  John W. Linville <[EMAIL PROTECTED]>
CommitDate: Mon Jun 11 14:28:39 2007 -0400

    [PATCH] libertas: fix error handling of card initialization
    
    Subject says it all.
    
    Signed-off-by: Marcelo Tosatti <[EMAIL PROTECTED]>
    Signed-off-by: John W. Linville <[EMAIL PROTECTED]>
---
 drivers/net/wireless/libertas/if_usb.c |   10 ++++++++--
 drivers/net/wireless/libertas/main.c   |    1 +
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/libertas/if_usb.c 
b/drivers/net/wireless/libertas/if_usb.c
index 7ce57d4..d4db8e6 100644
--- a/drivers/net/wireless/libertas/if_usb.c
+++ b/drivers/net/wireless/libertas/if_usb.c
@@ -198,10 +198,10 @@ static int if_usb_probe(struct usb_interface *intf,
                goto dealloc;
 
        if (wlan_add_mesh(priv))
-               goto dealloc;
+               goto err_add_mesh;
 
        if (libertas_activate_card(priv))
-               goto dealloc;
+               goto err_activate_card;
 
        if (libertas_found < MAX_DEVS) {
                libertas_devs[libertas_found] = priv->wlan_dev.netdev;
@@ -218,6 +218,12 @@ static int if_usb_probe(struct usb_interface *intf,
         */
        return 0;
 
+err_activate_card:
+       unregister_netdev(priv->mesh_dev);
+       free_netdev(priv->mesh_dev);
+err_add_mesh:
+       free_netdev(priv->wlan_dev.netdev);
+       kfree(priv->adapter);
 dealloc:
        if_usb_free(usb_cardp);
 
diff --git a/drivers/net/wireless/libertas/main.c 
b/drivers/net/wireless/libertas/main.c
index 8990901..5c58c50 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -823,6 +823,7 @@ wlan_private *wlan_add_card(void *card)
 
 err_kzalloc:
        free_netdev(dev);
+       priv = NULL;
 done:
        lbs_deb_leave_args(LBS_DEB_NET, "priv %p", priv);
        return priv;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to