Skip to content

Commit be9c6ba

Browse files
Dan Carpentermstsirkin
authored andcommitted
vdpa: potential uninitialized return in vhost_vdpa_va_map()
The concern here is that "ret" can be uninitialized if we hit the "goto next" condition on every iteration through the loop. Fixes: 41ba1b5f9d4b ("vdpa: Support transferring virtual addressing during DMA mapping") Signed-off-by: Dan Carpenter <[email protected]> Link: https://lore.kernel.org/r/20210907073253.GB18254@kili Signed-off-by: Michael S. Tsirkin <[email protected]> Reviewed-by: Xie Yongji <[email protected]> Acked-by: Jason Wang <[email protected]> Reviewed-by: Stefano Garzarella <[email protected]>
1 parent 759be89 commit be9c6ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/vhost/vdpa.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ static int vhost_vdpa_va_map(struct vhost_vdpa *v,
640640
u64 offset, map_size, map_iova = iova;
641641
struct vdpa_map_file *map_file;
642642
struct vm_area_struct *vma;
643-
int ret;
643+
int ret = 0;
644644

645645
mmap_read_lock(dev->mm);
646646

0 commit comments

Comments
 (0)