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: 3ae4729202 ("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>
This commit is contained in:
weiyongjun (A) 2017-10-17 12:11:22 +00:00 committed by Alex Williamson
parent a593472591
commit 105a004e21
1 changed files with 1 additions and 1 deletions

View File

@ -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;