Input: fm801-gp - add missing call to pci_disable_device()
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 30 Sep 2010 01:17:16 +0000 (18:17 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 30 Sep 2010 01:25:56 +0000 (18:25 -0700)
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/gameport/emu10k1-gp.c
drivers/input/gameport/fm801-gp.c

index 34615d40528a1f204f7a5d61c9f71b4bf232ca37..f85620590b66eaf82cb249d77d54b1cdae2f8819 100644 (file)
@@ -106,8 +106,9 @@ static void __devexit emu_remove(struct pci_dev *pdev)
 
        gameport_unregister_port(emu->gameport);
        release_region(emu->io, emu->size);
-       pci_disable_device(pdev);
        kfree(emu);
+
+       pci_disable_device(pdev);
 }
 
 static struct pci_driver emu_driver = {
index 14d3f3e208a2f557a80156dbe51c29f8aa0a0773..a3b70ff21018bce1c7e6e82e83ad429785d36d62 100644 (file)
@@ -133,11 +133,11 @@ static void __devexit fm801_gp_remove(struct pci_dev *pci)
 {
        struct fm801_gp *gp = pci_get_drvdata(pci);
 
-       if (gp) {
-               gameport_unregister_port(gp->gameport);
-               release_resource(gp->res_port);
-               kfree(gp);
-       }
+       gameport_unregister_port(gp->gameport);
+       release_resource(gp->res_port);
+       kfree(gp);
+
+       pci_disable_device(pci);
 }
 
 static const struct pci_device_id fm801_gp_id_table[] = {