Skip to content

Commit a514a6e

Browse files
eaugerjoergroedel
authored andcommitted
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 6c65fb3 ("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>
1 parent 909111b commit a514a6e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/iommu/iommu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ iommu_insert_device_resv_regions(struct list_head *dev_resv_regions,
205205
struct list_head *group_resv_regions)
206206
{
207207
struct iommu_resv_region *entry;
208-
int ret;
208+
int ret = 0;
209209

210210
list_for_each_entry(entry, dev_resv_regions, list) {
211211
ret = iommu_insert_resv_region(entry, group_resv_regions);

0 commit comments

Comments
 (0)