memstick: r592: Fix UAF bug in r592_remove due to race condition
[sfrench/cifs-2.6.git] / drivers / memstick / host / r592.c
index 1d35d147552d4af0f34feaf20068deb0310dc038..42bfc46842b8271d5db351a01bde13fd5306c4dd 100644 (file)
@@ -829,7 +829,7 @@ static void r592_remove(struct pci_dev *pdev)
        /* Stop the processing thread.
        That ensures that we won't take any more requests */
        kthread_stop(dev->io_thread);
-
+       del_timer_sync(&dev->detect_timer);
        r592_enable_device(dev, false);
 
        while (!error && dev->req) {