summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-09-29 21:37:04 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-09-29 21:37:04 +0400
commit6a3e3dbee62a8fcf13c349b141b3cedf35a65c41 (patch)
treefeb306790403c1eb203a310c83a6175fc0ba1189 /drivers
parent21e98932dcf15fe7eabd09a35f2020e0dd86b685 (diff)
parent0774e392555a128cff7a94929b9ce957927fef49 (diff)
downloadlinux-6a3e3dbee62a8fcf13c349b141b3cedf35a65c41.tar.xz
Merge tag 'iommu-fixes-v3.6-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu
Pull IOMMU fixes from Joerg Roedel: "Two small patches: * One patch to fix the function declarations for !CONFIG_IOMMU_API. This is causing build errors in linux-next and should be fixed for v3.6. * Another patch to fix an IOMMU group related NULL pointer dereference." * tag 'iommu-fixes-v3.6-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: iommu/amd: Fix wrong assumption in iommu-group specific code iommu: static inline iommu group stub functions
Diffstat (limited to 'drivers')
-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 */