summaryrefslogtreecommitdiff
path: root/drivers/iommu/tegra-smmu.c
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2017-12-20 03:06:09 +0000
committerThierry Reding <treding@nvidia.com>2017-12-20 18:32:08 +0100
commit83476bfaf6ac1cebf0cc5a3bdcf5031ef875cf42 (patch)
treec88d555e200ff98ead65e814d201c4acf6d2213b /drivers/iommu/tegra-smmu.c
parent7f4c9176f760f4006af9f0863403f977a0bb3c52 (diff)
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 <weiyongjun1@huawei.com> Acked-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/iommu/tegra-smmu.c')
-rw-r--r--drivers/iommu/tegra-smmu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c
index 8885635d0a3b..44d40bc771b5 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;