[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 05/44] tests: vhost-user-test: initialize 'fd' in chr
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 05/44] tests: vhost-user-test: initialize 'fd' in chr_read |
Date: |
Mon, 14 Jan 2019 20:35:30 -0500 |
From: Li Qiang <address@hidden>
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: Li Qiang <address@hidden>
Reviewed-by: Thomas Huth <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
tests/vhost-user-test.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c
index 54982f68e7..84e50d84e7 100644
--- a/tests/vhost-user-test.c
+++ b/tests/vhost-user-test.c
@@ -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);
--
MST
- [Qemu-devel] [PULL 10/44] tests: acpi: simplify rsdt handling, (continued)
- [Qemu-devel] [PULL 10/44] tests: acpi: simplify rsdt handling, Michael S. Tsirkin, 2019/01/14
- [Qemu-devel] [PULL 06/44] vhost-user: fix ioeventfd_enabled, Michael S. Tsirkin, 2019/01/14
- [Qemu-devel] [PULL 07/44] util: check the return value of fcntl in qemu_set_{block, nonblock}, Michael S. Tsirkin, 2019/01/14
- [Qemu-devel] [PULL 08/44] tests: acpi: use AcpiSdtTable::aml in consistent way, Michael S. Tsirkin, 2019/01/14
- [Qemu-devel] [PULL 17/44] virtio-net: changed VIRTIO_NET_F_RSC_EXT to be 61, Michael S. Tsirkin, 2019/01/14
- [Qemu-devel] [PULL 23/44] virtio: split virtio 9p bits from virtio-pci, Michael S. Tsirkin, 2019/01/14
- [Qemu-devel] [PULL 14/44] tests: acpi: squash sanitize_fadt_ptrs() into test_acpi_fadt_table(), Michael S. Tsirkin, 2019/01/14
- [Qemu-devel] [PULL 12/44] tests: acpi: reuse fetch_table() in vmgenid-test, Michael S. Tsirkin, 2019/01/14
- [Qemu-devel] [PULL 09/44] tests: acpi: make sure FADT is fetched only once, Michael S. Tsirkin, 2019/01/14
- [Qemu-devel] [PULL 01/44] pci/pcie: stop plug/unplug if the slot is locked, Michael S. Tsirkin, 2019/01/14
- [Qemu-devel] [PULL 05/44] tests: vhost-user-test: initialize 'fd' in chr_read,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 04/44] qemu: avoid memory leak while remove disk, Michael S. Tsirkin, 2019/01/14
- [Qemu-devel] [PULL 02/44] msix: make pba size math more uniform, Michael S. Tsirkin, 2019/01/14
- [Qemu-devel] [PULL 03/44] hw/misc/ivshmem: Remove deprecated "ivshmem" legacy device, Michael S. Tsirkin, 2019/01/14
- [Qemu-devel] [PULL 26/44] virtio: split vhost scsi bits from virtio-pci, Michael S. Tsirkin, 2019/01/14
- [Qemu-devel] [PULL 11/44] tests: acpi: reuse fetch_table() for fetching FACS and DSDT, Michael S. Tsirkin, 2019/01/14
- Re: [Qemu-devel] [PULL 00/44] pci, pc, virtio: fixes, features, Peter Xu, 2019/01/15