[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/2] libvhost-user: return on error in vu_log_queue_fill()
From: |
Stefan Hajnoczi |
Subject: |
[PATCH 2/2] libvhost-user: return on error in vu_log_queue_fill() |
Date: |
Mon, 21 Sep 2020 12:34:20 +0100 |
vu_panic() is not guaranteed to exit the program. Return early when
errors are encountered.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
contrib/libvhost-user/libvhost-user.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/contrib/libvhost-user/libvhost-user.c
b/contrib/libvhost-user/libvhost-user.c
index 27626e629a..1fc2cb12ce 100644
--- a/contrib/libvhost-user/libvhost-user.c
+++ b/contrib/libvhost-user/libvhost-user.c
@@ -2722,6 +2722,7 @@ vu_log_queue_fill(VuDev *dev, VuVirtq *vq,
if (desc[i].flags & VRING_DESC_F_INDIRECT) {
if (desc[i].len % sizeof(struct vring_desc)) {
vu_panic(dev, "Invalid size for indirect buffer table");
+ return;
}
/* loop over the indirect descriptor table */
--
2.26.2