summaryrefslogtreecommitdiff
path: root/drivers/iommu
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2012-10-06 03:19:06 +0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-10-06 03:19:06 +0400
commitb4874a3d298606c20118d1ead73235439bbc2823 (patch)
tree0b6122df3a52650c7861c8e505c01fc381bc43e8 /drivers/iommu
parentceaa1a13c0e53242555fa45887d82339a3f93c78 (diff)
parent8ef102c6b4bc996ff96ca52b34775fe931ec90c9 (diff)
downloadlinux-b4874a3d298606c20118d1ead73235439bbc2823.tar.xz
Merge branch 'fixes' into for-linus
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/amd_iommu.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index b64502dfa9f4..e89daf1b21b4 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -266,7 +266,7 @@ static void swap_pci_ref(struct pci_dev **from, struct pci_dev *to)
static int iommu_init_device(struct device *dev)
{
- struct pci_dev *dma_pdev, *pdev = to_pci_dev(dev);
+ struct pci_dev *dma_pdev = NULL, *pdev = to_pci_dev(dev);
struct iommu_dev_data *dev_data;
struct iommu_group *group;
u16 alias;
@@ -293,7 +293,9 @@ static int iommu_init_device(struct device *dev)
dev_data->alias_data = alias_data;
dma_pdev = pci_get_bus_and_slot(alias >> 8, alias & 0xff);
- } else
+ }
+
+ if (dma_pdev == NULL)
dma_pdev = pci_dev_get(pdev);
/* Account for quirked devices */