kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] vdpa: potential uninitialized return in vhost_vdpa_va_map()
@ 2021-09-07  7:32 Dan Carpenter
  2021-09-07  8:41 ` Yongji Xie
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Dan Carpenter @ 2021-09-07  7:32 UTC (permalink / raw)
  To: Michael S. Tsirkin, Xie Yongji
  Cc: Jason Wang, virtualization, kernel-janitors

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 <dan.carpenter@oracle.com>
---
 drivers/vhost/vdpa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
index d0c0fedf2c09..170166806714 100644
--- a/drivers/vhost/vdpa.c
+++ b/drivers/vhost/vdpa.c
@@ -640,7 +640,7 @@ static int vhost_vdpa_va_map(struct vhost_vdpa *v,
 	u64 offset, map_size, map_iova = iova;
 	struct vdpa_map_file *map_file;
 	struct vm_area_struct *vma;
-	int ret;
+	int ret = 0;
 
 	mmap_read_lock(dev->mm);
 
-- 
2.20.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] vdpa: potential uninitialized return in vhost_vdpa_va_map()
  2021-09-07  7:32 [PATCH] vdpa: potential uninitialized return in vhost_vdpa_va_map() Dan Carpenter
@ 2021-09-07  8:41 ` Yongji Xie
  2021-09-07  9:07 ` Jason Wang
  2021-09-07  9:28 ` Stefano Garzarella
  2 siblings, 0 replies; 4+ messages in thread
From: Yongji Xie @ 2021-09-07  8:41 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Michael S. Tsirkin, Jason Wang, virtualization, kernel-janitors

On Tue, Sep 7, 2021 at 3:33 PM Dan Carpenter <dan.carpenter@oracle.com> wrote:
>
> 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 <dan.carpenter@oracle.com>
> ---
>  drivers/vhost/vdpa.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Xie Yongji <xieyongji@bytedance.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] vdpa: potential uninitialized return in vhost_vdpa_va_map()
  2021-09-07  7:32 [PATCH] vdpa: potential uninitialized return in vhost_vdpa_va_map() Dan Carpenter
  2021-09-07  8:41 ` Yongji Xie
@ 2021-09-07  9:07 ` Jason Wang
  2021-09-07  9:28 ` Stefano Garzarella
  2 siblings, 0 replies; 4+ messages in thread
From: Jason Wang @ 2021-09-07  9:07 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Michael S. Tsirkin, Xie Yongji, virtualization, kernel-janitors

On Tue, Sep 7, 2021 at 3:33 PM Dan Carpenter <dan.carpenter@oracle.com> wrote:
>
> 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 <dan.carpenter@oracle.com>
> ---
>  drivers/vhost/vdpa.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
> index d0c0fedf2c09..170166806714 100644
> --- a/drivers/vhost/vdpa.c
> +++ b/drivers/vhost/vdpa.c
> @@ -640,7 +640,7 @@ static int vhost_vdpa_va_map(struct vhost_vdpa *v,
>         u64 offset, map_size, map_iova = iova;
>         struct vdpa_map_file *map_file;
>         struct vm_area_struct *vma;
> -       int ret;
> +       int ret = 0;
>
>         mmap_read_lock(dev->mm);
>
> --
> 2.20.1
>

Acked-by: Jason Wang <jasowang@redhat.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] vdpa: potential uninitialized return in vhost_vdpa_va_map()
  2021-09-07  7:32 [PATCH] vdpa: potential uninitialized return in vhost_vdpa_va_map() Dan Carpenter
  2021-09-07  8:41 ` Yongji Xie
  2021-09-07  9:07 ` Jason Wang
@ 2021-09-07  9:28 ` Stefano Garzarella
  2 siblings, 0 replies; 4+ messages in thread
From: Stefano Garzarella @ 2021-09-07  9:28 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Michael S. Tsirkin, Xie Yongji, kernel-janitors, virtualization

On Tue, Sep 07, 2021 at 10:32:53AM +0300, Dan Carpenter wrote:
>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 <dan.carpenter@oracle.com>
>---
> drivers/vhost/vdpa.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
>index d0c0fedf2c09..170166806714 100644
>--- a/drivers/vhost/vdpa.c
>+++ b/drivers/vhost/vdpa.c
>@@ -640,7 +640,7 @@ static int vhost_vdpa_va_map(struct vhost_vdpa *v,
> 	u64 offset, map_size, map_iova = iova;
> 	struct vdpa_map_file *map_file;
> 	struct vm_area_struct *vma;
>-	int ret;
>+	int ret = 0;
>
> 	mmap_read_lock(dev->mm);
>
>-- 
>2.20.1
>
>_______________________________________________
>Virtualization mailing list
>Virtualization@lists.linux-foundation.org
>https://lists.linuxfoundation.org/mailman/listinfo/virtualization
>

Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-09-07  9:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-07  7:32 [PATCH] vdpa: potential uninitialized return in vhost_vdpa_va_map() Dan Carpenter
2021-09-07  8:41 ` Yongji Xie
2021-09-07  9:07 ` Jason Wang
2021-09-07  9:28 ` Stefano Garzarella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).