]> git.proxmox.com Git - mirror_qemu.git/commitdiff
libvhost-user: return on error in vu_log_queue_fill()
authorStefan Hajnoczi <stefanha@redhat.com>
Mon, 21 Sep 2020 11:34:20 +0000 (12:34 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 29 Sep 2020 07:06:12 +0000 (03:06 -0400)
vu_panic() is not guaranteed to exit the program. Return early when
errors are encountered.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20200921113420.154378-3-stefanha@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
contrib/libvhost-user/libvhost-user.c

index 4ebfa4cc40640f92797d6a34f1530f0886448c69..9f1285b8a1c448c4f5452eb56856780abac755b7 100644 (file)
@@ -2733,6 +2733,7 @@ vu_log_queue_fill(VuDev *dev, VuVirtq *vq,
     if (lduw_le_p(&desc[i].flags) & VRING_DESC_F_INDIRECT) {
         if (ldl_le_p(&desc[i].len) % sizeof(struct vring_desc)) {
             vu_panic(dev, "Invalid size for indirect buffer table");
+            return;
         }
 
         /* loop over the indirect descriptor table */