summaryrefslogtreecommitdiffstats
path: root/drivers/iommu
diff options
context:
space:
mode:
authorweiyongjun (A) <weiyongjun1@huawei.com>2017-10-17 14:11:22 +0200
committerAlex Williamson <alex.williamson@redhat.com>2017-11-06 18:26:26 +0100
commit105a004e2187609a74f75d55fd0f9a054b49d60a (patch)
tree8e350aeaa7f8ab65082fb41aec6ff94f72bba7c7 /drivers/iommu
parentMerge branches 'iommu/fixes', 'arm/omap', 'arm/exynos', 'x86/amd', 'x86/vt-d'... (diff)
downloadlinux-105a004e2187609a74f75d55fd0f9a054b49d60a.tar.xz
linux-105a004e2187609a74f75d55fd0f9a054b49d60a.zip
iommu/ipmmu-vmsa: Fix return value check in ipmmu_find_group_dma()
In case of error, the function iommu_group_get() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Fixes: 3ae47292024f ("iommu/ipmmu-vmsa: Add new IOMMU_DOMAIN_DMA ops") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/ipmmu-vmsa.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c
index af8140054273..00e88a88ee3a 100644
--- a/drivers/iommu/ipmmu-vmsa.c
+++ b/drivers/iommu/ipmmu-vmsa.c
@@ -871,7 +871,7 @@ static struct iommu_group *ipmmu_find_group_dma(struct device *dev)
sibling = ipmmu_find_sibling_device(dev);
if (sibling)
group = iommu_group_get(sibling);
- if (!sibling || IS_ERR(group))
+ if (!sibling || !group)
group = generic_device_group(dev);
return group;