From: weiyongjun (A) Date: Tue, 17 Oct 2017 12:11:22 +0000 (+0000) Subject: iommu/ipmmu-vmsa: Fix return value check in ipmmu_find_group_dma() X-Git-Tag: v5.15~10028^2^4~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=105a004e2187609a74f75d55fd0f9a054b49d60a;p=platform%2Fkernel%2Flinux-starfive.git 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 Signed-off-by: Alex Williamson --- diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c index af81400..00e88a8 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;