Input: emu10k1-gp - add missing calls to pci_disable_device()
authorRahul Ruikar <rahul.ruikar@gmail.com>
Thu, 30 Sep 2010 01:12:46 +0000 (18:12 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 30 Sep 2010 01:25:52 +0000 (18:25 -0700)
pci_disable_device() is called for following 2 cases
- error path in emu_probe()
- in emu_remove()

Signed-off-by: Rahul Ruikar <rahul.ruikar@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/gameport/emu10k1-gp.c

index 7392992da4243c35e127466035e1f35cb377af3a..34615d40528a1f204f7a5d61c9f71b4bf232ca37 100644 (file)
@@ -77,6 +77,7 @@ static int __devinit emu_probe(struct pci_dev *pdev, const struct pci_device_id
        if (!emu || !port) {
                printk(KERN_ERR "emu10k1-gp: Memory allocation failed\n");
                release_region(ioport, iolen);
+               pci_disable_device(pdev);
                kfree(emu);
                gameport_free_port(port);
                return -ENOMEM;
@@ -105,6 +106,7 @@ 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);
 }