kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] iommu: silence an uninintialized variable warning
       [not found] ` <77520e58-f6e9-f4d5-d909-90cea7ed6bae-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2017-02-06  9:18   ` Dan Carpenter
  2017-02-06  9:48     ` Dan Carpenter
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2017-02-06  9:18 UTC (permalink / raw)
  To: Joerg Roedel, Eric Auger
  Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA

My static checker complains that we return an uninitialized scalar if
the list is empty.  If that's the case then we should return zero.

Fixes: 6c65fb318e8b ("iommu: iommu_get_group_resv_regions")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index b752c3d91cfc..0e1750481ebc 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -210,9 +210,9 @@ iommu_insert_device_resv_regions(struct list_head *dev_resv_regions,
 	list_for_each_entry(entry, dev_resv_regions, list) {
 		ret = iommu_insert_resv_region(entry, group_resv_regions);
 		if (ret)
-			break;
+			return ret;
 	}
-	return ret;
+	return 0;
 }
 
 int iommu_get_group_resv_regions(struct iommu_group *group,

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

* Re: [patch] iommu: silence an uninintialized variable warning
  2017-02-06  9:18   ` [patch] iommu: silence an uninintialized variable warning Dan Carpenter
@ 2017-02-06  9:48     ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2017-02-06  9:48 UTC (permalink / raw)
  To: Joerg Roedel, Eric Auger
  Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA

Never mind. Eric just sent his own patch.

regards,
dan carpenter


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

end of thread, other threads:[~2017-02-06  9:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <77520e58-f6e9-f4d5-d909-90cea7ed6bae@redhat.com>
     [not found] ` <77520e58-f6e9-f4d5-d909-90cea7ed6bae-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-02-06  9:18   ` [patch] iommu: silence an uninintialized variable warning Dan Carpenter
2017-02-06  9:48     ` Dan Carpenter

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).