iommu: fix static checker warning in iommu_insert_device_resv_regions
PATCH 1/1 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 <[email protected]>
Signed-off-by Eric Auger <[email protected]>
---
Applies on top of iommu-next
--- drivers/iommu/iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/iommu.c +1 -1
@@ -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);
Signature · 1 line
2.5.5
Quoted 8 lines · Eric Auger
In case the device reserved region list is void, the returned value of
iommu_insert_device_resv_regionsis uninitialized. Let's return 0 in that case.This fixes commit
6c65fb318e8b("iommu:iommu_get_group_resv_regions").Reported-by Dan Carpenter <[email protected]>Signed-off-by Eric Auger <[email protected]>
Applied, thanks.