From f4c1456a921afa804aceeb09bade9bb6b3cd60e1 Mon Sep 17 00:00:00 2001 From: Chenbo Xia Date: Tue, 14 Jul 2020 11:03:05 +0000 Subject: [PATCH] net/virtio-user: fix uninitialized reply-ack variable This patch fixes an issue that uninitialized has_reply_ack is used for setting message flags. Coverity issue: 360834 Fixes: c60208dd6384 ("net/virtio-user: support reply-ack") Signed-off-by: Chenbo Xia Acked-by: Adrian Moreno --- drivers/net/virtio/virtio_user/vhost_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/virtio/virtio_user/vhost_user.c b/drivers/net/virtio/virtio_user/vhost_user.c index 631d0e3539..ad48bafd48 100644 --- a/drivers/net/virtio/virtio_user/vhost_user.c +++ b/drivers/net/virtio/virtio_user/vhost_user.c @@ -254,7 +254,7 @@ vhost_user_sock(struct virtio_user_dev *dev, struct vhost_user_msg msg; struct vhost_vring_file *file = 0; int need_reply = 0; - int has_reply_ack; + int has_reply_ack = 0; int fds[VHOST_MEMORY_MAX_NREGIONS]; int fd_num = 0; int len; -- 2.20.1