From: Wei Yongjun Date: Wed, 20 Dec 2017 03:06:09 +0000 (+0000) Subject: iommu/tegra-smmu: Fix return value check in tegra_smmu_group_get() X-Git-Tag: v4.16-rc1~98^2~22^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=83476bfaf6ac1cebf0cc5a3bdcf5031ef875cf42;p=thirdparty%2Fkernel%2Flinux.git iommu/tegra-smmu: Fix return value check in tegra_smmu_group_get() In case of error, the function iommu_group_alloc() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Fixes: 7f4c9176f760 ("iommu/tegra: Allow devices to be grouped") Signed-off-by: Wei Yongjun Acked-by: Alex Williamson Signed-off-by: Thierry Reding --- diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c index 8885635d0a3be..44d40bc771b51 100644 --- a/drivers/iommu/tegra-smmu.c +++ b/drivers/iommu/tegra-smmu.c @@ -832,7 +832,7 @@ static struct iommu_group *tegra_smmu_group_get(struct tegra_smmu *smmu, group->soc = soc; group->group = iommu_group_alloc(); - if (!group->group) { + if (IS_ERR(group->group)) { devm_kfree(smmu->dev, group); mutex_unlock(&smmu->lock); return NULL;