qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PULL 0/2] Trivial branch for 7.1 patches
@ 2022-08-09 16:55 Laurent Vivier
  2022-08-09 16:55 ` [PULL 1/2] contrib/vhost-user-blk: Clean up deallocation of VuVirtqElement Laurent Vivier
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Laurent Vivier @ 2022-08-09 16:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Laurent Vivier

The following changes since commit c669f22f1a47897e8d1d595d6b8a59a572f9158c:

  Merge tag 'pull-la-20220805' of https://gitlab.com/rth7680/qemu into staging (2022-08-05 12:55:53 -0700)

are available in the Git repository at:

  https://gitlab.com/laurent_vivier/qemu.git tags/trivial-branch-for-7.1-pull-request

for you to fetch changes up to 9390da5ef29a5e0f98e5b482dceeeb287c452f17:

  xlnx_dp: drop unsupported AUXCommand in xlnx_dp_aux_set_command (2022-08-08 11:40:06 +0200)

----------------------------------------------------------------
Pull request trivial branch 20220809

----------------------------------------------------------------

Markus Armbruster (1):
  contrib/vhost-user-blk: Clean up deallocation of VuVirtqElement

Qiang Liu (1):
  xlnx_dp: drop unsupported AUXCommand in xlnx_dp_aux_set_command

 contrib/vhost-user-blk/vhost-user-blk.c | 9 +++------
 hw/display/xlnx_dp.c                    | 4 ++--
 2 files changed, 5 insertions(+), 8 deletions(-)

-- 
2.37.1



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

* [PULL 1/2] contrib/vhost-user-blk: Clean up deallocation of VuVirtqElement
  2022-08-09 16:55 [PULL 0/2] Trivial branch for 7.1 patches Laurent Vivier
@ 2022-08-09 16:55 ` Laurent Vivier
  2022-08-09 16:55 ` [PULL 2/2] xlnx_dp: drop unsupported AUXCommand in xlnx_dp_aux_set_command Laurent Vivier
  2022-08-09 21:44 ` [PULL 0/2] Trivial branch for 7.1 patches Richard Henderson
  2 siblings, 0 replies; 4+ messages in thread
From: Laurent Vivier @ 2022-08-09 16:55 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Markus Armbruster, Raphael Norwitz,
	Michael S . Tsirkin, Laurent Vivier

From: Markus Armbruster <armbru@redhat.com>

We allocate VuVirtqElement with g_malloc() in
virtqueue_alloc_element(), but free it with free() in
vhost-user-blk.c.  Harmless, but use g_free() anyway.

One of the calls is guarded by a "not null" condition.  Useless,
because it cannot be null (it's dereferenced right before), and even
it it could be, free() and g_free() do the right thing.  Drop the
conditional.

Fixes: Coverity CID 1490290
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Raphael Norwitz <raphael.norwitz@nutanix.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20220630085219.1305519-1-armbru@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 contrib/vhost-user-blk/vhost-user-blk.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/contrib/vhost-user-blk/vhost-user-blk.c b/contrib/vhost-user-blk/vhost-user-blk.c
index 9cb78ca1d0df..d6932a264573 100644
--- a/contrib/vhost-user-blk/vhost-user-blk.c
+++ b/contrib/vhost-user-blk/vhost-user-blk.c
@@ -106,10 +106,7 @@ static void vub_req_complete(VubReq *req)
                   req->size + 1);
     vu_queue_notify(vu_dev, req->vq);
 
-    if (req->elem) {
-        free(req->elem);
-    }
-
+    g_free(req->elem);
     g_free(req);
 }
 
@@ -243,7 +240,7 @@ static int vub_virtio_process_req(VubDev *vdev_blk,
     /* refer to hw/block/virtio_blk.c */
     if (elem->out_num < 1 || elem->in_num < 1) {
         fprintf(stderr, "virtio-blk request missing headers\n");
-        free(elem);
+        g_free(elem);
         return -1;
     }
 
@@ -325,7 +322,7 @@ static int vub_virtio_process_req(VubDev *vdev_blk,
     return 0;
 
 err:
-    free(elem);
+    g_free(elem);
     g_free(req);
     return -1;
 }
-- 
2.37.1



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

* [PULL 2/2] xlnx_dp: drop unsupported AUXCommand in xlnx_dp_aux_set_command
  2022-08-09 16:55 [PULL 0/2] Trivial branch for 7.1 patches Laurent Vivier
  2022-08-09 16:55 ` [PULL 1/2] contrib/vhost-user-blk: Clean up deallocation of VuVirtqElement Laurent Vivier
@ 2022-08-09 16:55 ` Laurent Vivier
  2022-08-09 21:44 ` [PULL 0/2] Trivial branch for 7.1 patches Richard Henderson
  2 siblings, 0 replies; 4+ messages in thread
From: Laurent Vivier @ 2022-08-09 16:55 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Qiang Liu, Thomas Huth, Frederic Konrad,
	Laurent Vivier

From: Qiang Liu <cyruscyliu@gmail.com>

In xlnx_dp_aux_set_command, when the command leads to the default
branch, xlxn-dp will abort and then crash.

This patch removes this abort and drops this operation.

Fixes: 58ac482 ("introduce xlnx-dp")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/411
Reported-by: Qiang Liu <cyruscyliu@gmail.com>
Tested-by: Qiang Liu <cyruscyliu@gmail.com>
Suggested-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Qiang Liu <cyruscyliu@gmail.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Frederic Konrad <fkonrad@amd.com>
Message-Id: <20220808080116.2184881-1-cyruscyliu@gmail.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 hw/display/xlnx_dp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/display/xlnx_dp.c b/hw/display/xlnx_dp.c
index a071c818833b..b0828d65aa86 100644
--- a/hw/display/xlnx_dp.c
+++ b/hw/display/xlnx_dp.c
@@ -532,8 +532,8 @@ static void xlnx_dp_aux_set_command(XlnxDPState *s, uint32_t value)
         qemu_log_mask(LOG_UNIMP, "xlnx_dp: Write i2c status not implemented\n");
         break;
     default:
-        error_report("%s: invalid command: %u", __func__, cmd);
-        abort();
+        qemu_log_mask(LOG_GUEST_ERROR, "%s: invalid command: %u", __func__, cmd);
+        return;
     }
 
     s->core_registers[DP_INTERRUPT_SIGNAL_STATE] |= 0x04;
-- 
2.37.1



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

* Re: [PULL 0/2] Trivial branch for 7.1 patches
  2022-08-09 16:55 [PULL 0/2] Trivial branch for 7.1 patches Laurent Vivier
  2022-08-09 16:55 ` [PULL 1/2] contrib/vhost-user-blk: Clean up deallocation of VuVirtqElement Laurent Vivier
  2022-08-09 16:55 ` [PULL 2/2] xlnx_dp: drop unsupported AUXCommand in xlnx_dp_aux_set_command Laurent Vivier
@ 2022-08-09 21:44 ` Richard Henderson
  2 siblings, 0 replies; 4+ messages in thread
From: Richard Henderson @ 2022-08-09 21:44 UTC (permalink / raw)
  To: Laurent Vivier, qemu-devel; +Cc: qemu-trivial

On 8/9/22 09:55, Laurent Vivier wrote:
> The following changes since commit c669f22f1a47897e8d1d595d6b8a59a572f9158c:
> 
>    Merge tag 'pull-la-20220805' of https://gitlab.com/rth7680/qemu into staging (2022-08-05 12:55:53 -0700)
> 
> are available in the Git repository at:
> 
>    https://gitlab.com/laurent_vivier/qemu.git tags/trivial-branch-for-7.1-pull-request
> 
> for you to fetch changes up to 9390da5ef29a5e0f98e5b482dceeeb287c452f17:
> 
>    xlnx_dp: drop unsupported AUXCommand in xlnx_dp_aux_set_command (2022-08-08 11:40:06 +0200)
> 
> ----------------------------------------------------------------
> Pull request trivial branch 20220809

Applied, thanks.  Please update https://wiki.qemu.org/ChangeLog/7.1 as appropriate.


r~


> 
> ----------------------------------------------------------------
> 
> Markus Armbruster (1):
>    contrib/vhost-user-blk: Clean up deallocation of VuVirtqElement
> 
> Qiang Liu (1):
>    xlnx_dp: drop unsupported AUXCommand in xlnx_dp_aux_set_command
> 
>   contrib/vhost-user-blk/vhost-user-blk.c | 9 +++------
>   hw/display/xlnx_dp.c                    | 4 ++--
>   2 files changed, 5 insertions(+), 8 deletions(-)
> 



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

end of thread, other threads:[~2022-08-09 21:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-09 16:55 [PULL 0/2] Trivial branch for 7.1 patches Laurent Vivier
2022-08-09 16:55 ` [PULL 1/2] contrib/vhost-user-blk: Clean up deallocation of VuVirtqElement Laurent Vivier
2022-08-09 16:55 ` [PULL 2/2] xlnx_dp: drop unsupported AUXCommand in xlnx_dp_aux_set_command Laurent Vivier
2022-08-09 21:44 ` [PULL 0/2] Trivial branch for 7.1 patches Richard Henderson

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).