summaryrefslogtreecommitdiffstats
path: root/drivers/iommu
diff options
context:
space:
mode:
authorEric Auger <eric.auger@redhat.com>2017-02-06 10:11:38 +0100
committerJoerg Roedel <jroedel@suse.de>2017-02-06 14:08:53 +0100
commita514a6e241f051dd8a4a00a456382dec0b1af21b (patch)
treeefa01490e22bfb3f54fde575d5c82e38d6668c1c /drivers/iommu
parent909111ba0ba6aa228d9b6e9cf01dd68a46586cb4 (diff)
downloadlinux-a514a6e241f051dd8a4a00a456382dec0b1af21b.tar.bz2
iommu: Fix static checker warning in iommu_insert_device_resv_regions
In case the device reserved region list is void, the returned value of iommu_insert_device_resv_regions is uninitialized. Let's return 0 in that case. This fixes commit 6c65fb318e8b ("iommu: iommu_get_group_resv_regions"). Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/iommu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index 428455a21ee7..c37d701ddaa2 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -205,7 +205,7 @@ iommu_insert_device_resv_regions(struct list_head *dev_resv_regions,
struct list_head *group_resv_regions)
{
struct iommu_resv_region *entry;
- int ret;
+ int ret = 0;
list_for_each_entry(entry, dev_resv_regions, list) {
ret = iommu_insert_resv_region(entry, group_resv_regions);