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: 41ba1b5 ("vdpa: Support transferring virtual addressing during DMA mapping") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/20210907073253.GB18254@kili Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Xie Yongji <xieyongji@bytedance.com> Acked-by: Jason Wang <jasowang@redhat.com> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
1 parent 759be89 commit be9c6ba

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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)