Commit be9c6bad authored by Dan Carpenter's avatar Dan Carpenter Committed by Michael S. Tsirkin

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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20210907073253.GB18254@kiliSigned-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Reviewed-by: default avatarXie Yongji <xieyongji@bytedance.com>
Acked-by: default avatarJason Wang <jasowang@redhat.com>
Reviewed-by: default avatarStefano Garzarella <sgarzare@redhat.com>
parent 759be899
...@@ -640,7 +640,7 @@ static int vhost_vdpa_va_map(struct vhost_vdpa *v, ...@@ -640,7 +640,7 @@ static int vhost_vdpa_va_map(struct vhost_vdpa *v,
u64 offset, map_size, map_iova = iova; u64 offset, map_size, map_iova = iova;
struct vdpa_map_file *map_file; struct vdpa_map_file *map_file;
struct vm_area_struct *vma; struct vm_area_struct *vma;
int ret; int ret = 0;
mmap_read_lock(dev->mm); mmap_read_lock(dev->mm);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment