You need to sign in or sign up before continuing.
提交 83476bfa 编写于 作者: W Wei Yongjun 提交者: Thierry Reding

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: 7f4c9176 ("iommu/tegra: Allow devices to be grouped")
Signed-off-by: NWei Yongjun <weiyongjun1@huawei.com>
Acked-by: NAlex Williamson <alex.williamson@redhat.com>
Signed-off-by: NThierry Reding <treding@nvidia.com>
上级 7f4c9176
...@@ -832,7 +832,7 @@ static struct iommu_group *tegra_smmu_group_get(struct tegra_smmu *smmu, ...@@ -832,7 +832,7 @@ static struct iommu_group *tegra_smmu_group_get(struct tegra_smmu *smmu,
group->soc = soc; group->soc = soc;
group->group = iommu_group_alloc(); group->group = iommu_group_alloc();
if (!group->group) { if (IS_ERR(group->group)) {
devm_kfree(smmu->dev, group); devm_kfree(smmu->dev, group);
mutex_unlock(&smmu->lock); mutex_unlock(&smmu->lock);
return NULL; return NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册