rndis_wlan: free priv correctly when rndis_wext_bind fails
authorJussi Kivilinna <jussi.kivilinna@mbnet.fi>
Tue, 21 Apr 2009 16:48:15 +0000 (19:48 +0300)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 22 Apr 2009 20:57:20 +0000 (16:57 -0400)
Private structure is allocated by wiphy_new now, so use
wiphy_free instead of kfree.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rndis_wlan.c

index 9ef547d6724e018cd6e73300415d32034145e203..52fc647e6cb64c38c4010a5a721235d2ce600bcc 100644 (file)
@@ -2449,8 +2449,8 @@ static int rndis_wext_bind(struct usbnet *usbdev, struct usb_interface *intf)
        set_wiphy_dev(wiphy, &usbdev->udev->dev);
 
        if (wiphy_register(wiphy)) {
-               wiphy_free(wiphy);
-               return -ENODEV;
+               retval = -ENODEV;
+               goto fail;
        }
 
        set_default_iw_params(usbdev);
@@ -2472,7 +2472,7 @@ fail:
        flush_workqueue(priv->workqueue);
        destroy_workqueue(priv->workqueue);
 
-       kfree(priv);
+       wiphy_free(wiphy);
        return retval;
 }