All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] vhost-vdpa :Fix Coverity CID 1430270 / CID 1420267
@ 2020-07-10  6:46 Cindy Lu
  2020-07-10  8:07 ` Peter Maydell
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Cindy Lu @ 2020-07-10  6:46 UTC (permalink / raw)
  To: mst, peter.maydell, jasowang
  Cc: mhabets, qemu-devel, rob.miller, saugatm, lulu, hanand, hch,
	eperezma, jgg, shahafs, kevin.tian, parav, vmireyno,
	cunming.liang, gdawar, jiri, xiao.w.wang, stefanha, zhihong.wang,
	ian, aadam, rdunlap, maxime.coquelin, lingshan.zhu

In the function vhost_vdpa_dma_map/unmap, The struct msg was not initialized all its fields.

Signed-off-by: Cindy Lu <lulu@redhat.com>
---
 hw/virtio/vhost-vdpa.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
index a3d17fe0f9..b9265f3761 100644
--- a/hw/virtio/vhost-vdpa.c
+++ b/hw/virtio/vhost-vdpa.c
@@ -38,7 +38,7 @@ static bool vhost_vdpa_listener_skipped_section(MemoryRegionSection *section)
 static int vhost_vdpa_dma_map(struct vhost_vdpa *v, hwaddr iova, hwaddr size,
                               void *vaddr, bool readonly)
 {
-    struct vhost_msg_v2 msg;
+    struct vhost_msg_v2 msg = {};
     int fd = v->device_fd;
     int ret = 0;
 
@@ -61,7 +61,7 @@ static int vhost_vdpa_dma_map(struct vhost_vdpa *v, hwaddr iova, hwaddr size,
 static int vhost_vdpa_dma_unmap(struct vhost_vdpa *v, hwaddr iova,
                                 hwaddr size)
 {
-    struct vhost_msg_v2 msg;
+    struct vhost_msg_v2 msg = {};
     int fd = v->device_fd;
     int ret = 0;
 
-- 
2.21.1



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

* Re: [PATCH v2] vhost-vdpa :Fix Coverity CID 1430270 / CID 1420267
  2020-07-10  6:46 [PATCH v2] vhost-vdpa :Fix Coverity CID 1430270 / CID 1420267 Cindy Lu
@ 2020-07-10  8:07 ` Peter Maydell
  2020-07-10  9:14 ` Jason Wang
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Peter Maydell @ 2020-07-10  8:07 UTC (permalink / raw)
  To: Cindy Lu
  Cc: Michael S. Tsirkin, mhabets, QEMU Developers, rob.miller,
	saugatm, hanand, Christoph Hellwig, eperezma, jgg, Jason Wang,
	shahafs, Tian, Kevin, parav, vmireyno, cunming.liang, gdawar,
	jiri, xiao.w.wang, Stefan Hajnoczi, zhihong.wang, ian, aadam,
	rdunlap, Maxime Coquelin, Lingshan zhu

On Fri, 10 Jul 2020 at 07:47, Cindy Lu <lulu@redhat.com> wrote:
>
> In the function vhost_vdpa_dma_map/unmap, The struct msg was not initialized all its fields.
>
> Signed-off-by: Cindy Lu <lulu@redhat.com>
> ---
>  hw/virtio/vhost-vdpa.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


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

* Re: [PATCH v2] vhost-vdpa :Fix Coverity CID 1430270 / CID 1420267
  2020-07-10  6:46 [PATCH v2] vhost-vdpa :Fix Coverity CID 1430270 / CID 1420267 Cindy Lu
  2020-07-10  8:07 ` Peter Maydell
@ 2020-07-10  9:14 ` Jason Wang
  2020-07-10 10:29 ` Li Qiang
  2020-07-23 17:55 ` Peter Maydell
  3 siblings, 0 replies; 6+ messages in thread
From: Jason Wang @ 2020-07-10  9:14 UTC (permalink / raw)
  To: Cindy Lu, mst, peter.maydell
  Cc: mhabets, qemu-devel, rob.miller, saugatm, hanand, hch, eperezma,
	jgg, shahafs, kevin.tian, parav, vmireyno, cunming.liang, gdawar,
	jiri, xiao.w.wang, stefanha, zhihong.wang, ian, aadam, rdunlap,
	maxime.coquelin, lingshan.zhu


On 2020/7/10 下午2:46, Cindy Lu wrote:
> In the function vhost_vdpa_dma_map/unmap, The struct msg was not initialized all its fields.
>
> Signed-off-by: Cindy Lu <lulu@redhat.com>


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


> ---
>   hw/virtio/vhost-vdpa.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
> index a3d17fe0f9..b9265f3761 100644
> --- a/hw/virtio/vhost-vdpa.c
> +++ b/hw/virtio/vhost-vdpa.c
> @@ -38,7 +38,7 @@ static bool vhost_vdpa_listener_skipped_section(MemoryRegionSection *section)
>   static int vhost_vdpa_dma_map(struct vhost_vdpa *v, hwaddr iova, hwaddr size,
>                                 void *vaddr, bool readonly)
>   {
> -    struct vhost_msg_v2 msg;
> +    struct vhost_msg_v2 msg = {};
>       int fd = v->device_fd;
>       int ret = 0;
>   
> @@ -61,7 +61,7 @@ static int vhost_vdpa_dma_map(struct vhost_vdpa *v, hwaddr iova, hwaddr size,
>   static int vhost_vdpa_dma_unmap(struct vhost_vdpa *v, hwaddr iova,
>                                   hwaddr size)
>   {
> -    struct vhost_msg_v2 msg;
> +    struct vhost_msg_v2 msg = {};
>       int fd = v->device_fd;
>       int ret = 0;
>   



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

* Re: [PATCH v2] vhost-vdpa :Fix Coverity CID 1430270 / CID 1420267
  2020-07-10  6:46 [PATCH v2] vhost-vdpa :Fix Coverity CID 1430270 / CID 1420267 Cindy Lu
  2020-07-10  8:07 ` Peter Maydell
  2020-07-10  9:14 ` Jason Wang
@ 2020-07-10 10:29 ` Li Qiang
  2020-07-23 17:55 ` Peter Maydell
  3 siblings, 0 replies; 6+ messages in thread
From: Li Qiang @ 2020-07-10 10:29 UTC (permalink / raw)
  To: Cindy Lu
  Cc: Peter Maydell, Michael S. Tsirkin, Jason Wang, Qemu Developers,
	rob.miller, saugatm, maxime.coquelin, hch, eperezma, jgg,
	mhabets, shahafs, Tian, Kevin, parav, vmireyno, cunming.liang,
	gdawar, jiri, xiao.w.wang, Stefan Hajnoczi, zhihong.wang, ian,
	aadam, rdunlap, hanand, lingshan.zhu

Cindy Lu <lulu@redhat.com> 于2020年7月10日周五 下午2:47写道:
>
> In the function vhost_vdpa_dma_map/unmap, The struct msg was not initialized all its fields.
>
> Signed-off-by: Cindy Lu <lulu@redhat.com>

Reviewed-by: Li Qiang <liq3ea@gmail.com>

> ---
>  hw/virtio/vhost-vdpa.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
> index a3d17fe0f9..b9265f3761 100644
> --- a/hw/virtio/vhost-vdpa.c
> +++ b/hw/virtio/vhost-vdpa.c
> @@ -38,7 +38,7 @@ static bool vhost_vdpa_listener_skipped_section(MemoryRegionSection *section)
>  static int vhost_vdpa_dma_map(struct vhost_vdpa *v, hwaddr iova, hwaddr size,
>                                void *vaddr, bool readonly)
>  {
> -    struct vhost_msg_v2 msg;
> +    struct vhost_msg_v2 msg = {};
>      int fd = v->device_fd;
>      int ret = 0;
>
> @@ -61,7 +61,7 @@ static int vhost_vdpa_dma_map(struct vhost_vdpa *v, hwaddr iova, hwaddr size,
>  static int vhost_vdpa_dma_unmap(struct vhost_vdpa *v, hwaddr iova,
>                                  hwaddr size)
>  {
> -    struct vhost_msg_v2 msg;
> +    struct vhost_msg_v2 msg = {};
>      int fd = v->device_fd;
>      int ret = 0;
>
> --
> 2.21.1
>
>


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

* Re: [PATCH v2] vhost-vdpa :Fix Coverity CID 1430270 / CID 1420267
  2020-07-10  6:46 [PATCH v2] vhost-vdpa :Fix Coverity CID 1430270 / CID 1420267 Cindy Lu
                   ` (2 preceding siblings ...)
  2020-07-10 10:29 ` Li Qiang
@ 2020-07-23 17:55 ` Peter Maydell
  2020-07-27 13:29   ` Michael S. Tsirkin
  3 siblings, 1 reply; 6+ messages in thread
From: Peter Maydell @ 2020-07-23 17:55 UTC (permalink / raw)
  To: Cindy Lu; +Cc: QEMU Developers, Michael S. Tsirkin

(trimming down the rather exuberant CC list)

On Fri, 10 Jul 2020 at 07:47, Cindy Lu <lulu@redhat.com> wrote:
>
> In the function vhost_vdpa_dma_map/unmap, The struct msg was not initialized all its fields.
>
> Signed-off-by: Cindy Lu <lulu@redhat.com>
> ---
>  hw/virtio/vhost-vdpa.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Michael, I guess this should go via your tree ?

thanks
-- PMM


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

* Re: [PATCH v2] vhost-vdpa :Fix Coverity CID 1430270 / CID 1420267
  2020-07-23 17:55 ` Peter Maydell
@ 2020-07-27 13:29   ` Michael S. Tsirkin
  0 siblings, 0 replies; 6+ messages in thread
From: Michael S. Tsirkin @ 2020-07-27 13:29 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEMU Developers, Cindy Lu

On Thu, Jul 23, 2020 at 06:55:08PM +0100, Peter Maydell wrote:
> (trimming down the rather exuberant CC list)
> 
> On Fri, 10 Jul 2020 at 07:47, Cindy Lu <lulu@redhat.com> wrote:
> >
> > In the function vhost_vdpa_dma_map/unmap, The struct msg was not initialized all its fields.
> >
> > Signed-off-by: Cindy Lu <lulu@redhat.com>
> > ---
> >  hw/virtio/vhost-vdpa.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> Michael, I guess this should go via your tree ?
> 
> thanks
> -- PMM
Queues, thanks!



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

end of thread, other threads:[~2020-07-27 13:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-10  6:46 [PATCH v2] vhost-vdpa :Fix Coverity CID 1430270 / CID 1420267 Cindy Lu
2020-07-10  8:07 ` Peter Maydell
2020-07-10  9:14 ` Jason Wang
2020-07-10 10:29 ` Li Qiang
2020-07-23 17:55 ` Peter Maydell
2020-07-27 13:29   ` Michael S. Tsirkin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.