summaryrefslogtreecommitdiff
path: root/drivers/xen/xen-pciback/pci_stub.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/xen/xen-pciback/pci_stub.c')
-rw-r--r--drivers/xen/xen-pciback/pci_stub.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/xen/xen-pciback/pci_stub.c b/drivers/xen/xen-pciback/pci_stub.c
index bba527620507..e34b623e4b41 100644
--- a/drivers/xen/xen-pciback/pci_stub.c
+++ b/drivers/xen/xen-pciback/pci_stub.c
@@ -194,8 +194,6 @@ static struct pci_dev *pcistub_device_get_pci_dev(struct xen_pcibk_device *pdev,
struct pci_dev *pci_dev = NULL;
unsigned long flags;
- pcistub_device_get(psdev);
-
spin_lock_irqsave(&psdev->lock, flags);
if (!psdev->pdev) {
psdev->pdev = pdev;
@@ -203,8 +201,8 @@ static struct pci_dev *pcistub_device_get_pci_dev(struct xen_pcibk_device *pdev,
}
spin_unlock_irqrestore(&psdev->lock, flags);
- if (!pci_dev)
- pcistub_device_put(psdev);
+ if (pci_dev)
+ pcistub_device_get(psdev);
return pci_dev;
}