提交 82248cd4 编写于 作者: L Li Qiang 提交者: Michael S. Tsirkin

tests: vhost-user-test: initialize 'fd' in chr_read

Currently when processing VHOST_USER_SET_VRING_CALL
if 'qemu_chr_fe_get_msgfds' get no fd, the 'fd' will
be a stack uninitialized value.
Signed-off-by: NLi Qiang <liq3ea@163.com>
Reviewed-by: NThomas Huth <thuth@redhat.com>
Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
上级 a5390d93
......@@ -309,7 +309,7 @@ static void chr_read(void *opaque, const uint8_t *buf, int size)
CharBackend *chr = &s->chr;
VhostUserMsg msg;
uint8_t *p = (uint8_t *) &msg;
int fd;
int fd = -1;
if (s->test_fail) {
qemu_chr_fe_disconnect(chr);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册