ath6kl: remove incorrect reset_resume handler
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Fri, 31 Oct 2014 00:45:37 +0000 (02:45 +0200)
committerKalle Valo <kvalo@qca.qualcomm.com>
Mon, 3 Nov 2014 22:59:05 +0000 (00:59 +0200)
Existing implementation of reset_resume handler just calls
ath6kl_usb_remove() that deallocates all resources.
It can lead to double free, etc. on disconnect.

The patch removes reset_resume handler,
so usb core could conservatively reset the driver.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath6kl/usb.c

index a6a5e40..9da3594 100644 (file)
@@ -1193,18 +1193,10 @@ static int ath6kl_usb_pm_resume(struct usb_interface *interface)
        return 0;
 }
 
        return 0;
 }
 
-static int ath6kl_usb_pm_reset_resume(struct usb_interface *intf)
-{
-       if (usb_get_intfdata(intf))
-               ath6kl_usb_remove(intf);
-       return 0;
-}
-
 #else
 
 #define ath6kl_usb_pm_suspend NULL
 #define ath6kl_usb_pm_resume NULL
 #else
 
 #define ath6kl_usb_pm_suspend NULL
 #define ath6kl_usb_pm_resume NULL
-#define ath6kl_usb_pm_reset_resume NULL
 
 #endif
 
 
 #endif
 
@@ -1222,7 +1214,6 @@ static struct usb_driver ath6kl_usb_driver = {
        .probe = ath6kl_usb_probe,
        .suspend = ath6kl_usb_pm_suspend,
        .resume = ath6kl_usb_pm_resume,
        .probe = ath6kl_usb_probe,
        .suspend = ath6kl_usb_pm_suspend,
        .resume = ath6kl_usb_pm_resume,
-       .reset_resume = ath6kl_usb_pm_reset_resume,
        .disconnect = ath6kl_usb_remove,
        .id_table = ath6kl_usb_ids,
        .supports_autosuspend = true,
        .disconnect = ath6kl_usb_remove,
        .id_table = ath6kl_usb_ids,
        .supports_autosuspend = true,