diff options
Diffstat (limited to 'drivers/iommu')
-rw-r--r-- | drivers/iommu/amd_iommu.c | 6 |
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) | |||
266 | 266 | ||
267 | static int iommu_init_device(struct device *dev) | 267 | static int iommu_init_device(struct device *dev) |
268 | { | 268 | { |
269 | struct pci_dev *dma_pdev, *pdev = to_pci_dev(dev); | 269 | struct pci_dev *dma_pdev = NULL, *pdev = to_pci_dev(dev); |
270 | struct iommu_dev_data *dev_data; | 270 | struct iommu_dev_data *dev_data; |
271 | struct iommu_group *group; | 271 | struct iommu_group *group; |
272 | u16 alias; | 272 | u16 alias; |
@@ -293,7 +293,9 @@ static int iommu_init_device(struct device *dev) | |||
293 | dev_data->alias_data = alias_data; | 293 | dev_data->alias_data = alias_data; |
294 | 294 | ||
295 | dma_pdev = pci_get_bus_and_slot(alias >> 8, alias & 0xff); | 295 | dma_pdev = pci_get_bus_and_slot(alias >> 8, alias & 0xff); |
296 | } else | 296 | } |
297 | |||
298 | if (dma_pdev == NULL) | ||
297 | dma_pdev = pci_dev_get(pdev); | 299 | dma_pdev = pci_dev_get(pdev); |
298 | 300 | ||
299 | /* Account for quirked devices */ | 301 | /* Account for quirked devices */ |