iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] iommu/tegra-smmu: Fix return value check in tegra_smmu_group_get()
@ 2017-12-20  3:06 Wei Yongjun
       [not found] ` <1513739169-122341-1-git-send-email-weiyongjun1-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Yongjun @ 2017-12-20  3:06 UTC (permalink / raw)
  To: Hiroshi Doyu, Joerg Roedel, Thierry Reding, Jonathan Hunter
  Cc: Wei Yongjun, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA

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-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
---
 drivers/iommu/tegra-smmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c
index 8885635..44d40bc 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;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-12-20 17:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-20  3:06 [PATCH -next] iommu/tegra-smmu: Fix return value check in tegra_smmu_group_get() Wei Yongjun
     [not found] ` <1513739169-122341-1-git-send-email-weiyongjun1-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2017-12-20 16:44   ` Alex Williamson
     [not found]     ` <20171220094400.5b95004f-1yVPhWWZRC1BDLzU/O5InQ@public.gmane.org>
2017-12-20 17:41       ` Thierry Reding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).