]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Staging: ipack/bridges/tpci200: increment the reference counter of the pci_dev
authorSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Tue, 11 Sep 2012 11:35:05 +0000 (13:35 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Sep 2012 19:18:11 +0000 (12:18 -0700)
As indicated in the documentation of pci_dev_get.

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ipack/bridges/tpci200.c

index 383571c05112a0ab2c9ed4c5a0a02c30a210462d..b92814067061f7c96df15351885d0b2ce8353b00 100644 (file)
@@ -670,6 +670,8 @@ static int tpci200_pci_probe(struct pci_dev *pdev,
                goto out_err_info;
        }
 
+       pci_dev_get(pdev);
+
        /* Obtain a mapping of the carrier's PCI configuration registers */
        ret = pci_request_region(pdev, TPCI200_CFG_MEM_BAR,
                                 KBUILD_MODNAME " Configuration Memory");
@@ -741,6 +743,7 @@ out_err_install:
 out_err_ioremap:
        pci_release_region(pdev, TPCI200_CFG_MEM_BAR);
 out_err_pci_request:
+       pci_dev_put(pdev);
        kfree(tpci200->info);
 out_err_info:
        kfree(tpci200);