staging: sbe-2t3e3: Fix possible reuse of freed memory in timer function
authorKirill Tkhai <tkhai@yandex.ru>
Mon, 10 Feb 2014 18:40:11 +0000 (22:40 +0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Feb 2014 20:43:44 +0000 (12:43 -0800)
Do not call kfree() till timer function is finished.

[This was found using grep. Compilation tested only]

Signed-off-by: Kirill Tkhai <tkhai@yandex.ru>
CC: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/sbe-2t3e3/module.c

index 0e32be5c2471279b3aee8bd22788e1cef8dd9c8a..a6f93a43d216357ba82fbaa2ba5b435e8326751c 100644 (file)
@@ -122,7 +122,7 @@ static void t3e3_remove_card(struct pci_dev *pdev)
        struct channel *channel0 = pci_get_drvdata(pdev);
        struct card *card = channel0->card;
 
-       del_timer(&card->timer);
+       del_timer_sync(&card->timer);
        if (has_two_ports(channel0->pdev)) {
                t3e3_remove_channel(&card->channels[1]);
                pci_dev_put(card->channels[1].pdev);