diff options
author | Stefan Hajnoczi | 2020-09-21 13:34:20 +0200 |
---|---|---|
committer | Michael S. Tsirkin | 2020-09-29 09:06:12 +0200 |
commit | 8138405528c29af2a850cd672a8f8a0b33b7ab40 (patch) | |
tree | d24aa5f7d93dd37ef03aab19f9df6abe00da3069 /contrib/libvhost-user | |
parent | libvhost-user: return early on virtqueue errors (diff) | |
download | qemu-8138405528c29af2a850cd672a8f8a0b33b7ab40.tar.gz qemu-8138405528c29af2a850cd672a8f8a0b33b7ab40.tar.xz qemu-8138405528c29af2a850cd672a8f8a0b33b7ab40.zip |
libvhost-user: return on error in vu_log_queue_fill()
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>
Diffstat (limited to 'contrib/libvhost-user')
-rw-r--r-- | contrib/libvhost-user/libvhost-user.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/contrib/libvhost-user/libvhost-user.c b/contrib/libvhost-user/libvhost-user.c index 4ebfa4cc40..9f1285b8a1 100644 --- a/contrib/libvhost-user/libvhost-user.c +++ b/contrib/libvhost-user/libvhost-user.c @@ -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 */ |