aboutsummaryrefslogtreecommitdiff
path: root/contrib/vhost-user-input/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/vhost-user-input/main.c')
-rw-r--r--contrib/vhost-user-input/main.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/contrib/vhost-user-input/main.c b/contrib/vhost-user-input/main.c
index 6020c6f33a..d2de47cee7 100644
--- a/contrib/vhost-user-input/main.c
+++ b/contrib/vhost-user-input/main.c
@@ -12,8 +12,7 @@
#include "qemu/iov.h"
#include "qemu/bswap.h"
#include "qemu/sockets.h"
-#include "contrib/libvhost-user/libvhost-user.h"
-#include "contrib/libvhost-user/libvhost-user-glib.h"
+#include "libvhost-user-glib.h"
#include "standard-headers/linux/virtio_input.h"
#include "qapi/error.h"
@@ -212,7 +211,9 @@ static int vi_get_config(VuDev *dev, uint8_t *config, uint32_t len)
{
VuInput *vi = container_of(dev, VuInput, dev.parent);
- g_return_val_if_fail(len <= sizeof(*vi->sel_config), -1);
+ if (len > sizeof(*vi->sel_config)) {
+ return -1;
+ }
if (vi->sel_config) {
memcpy(config, vi->sel_config, len);