qemu/hw/block
Pan Nengyuan cfaf757edd virtio-blk: delete vqs on the error path in realize()
virtio_vqs forgot to free on the error path in realize(). Fix that.

The asan stack:
Direct leak of 14336 byte(s) in 1 object(s) allocated from:
    #0 0x7f58b93fd970 in __interceptor_calloc (/lib64/libasan.so.5+0xef970)
    #1 0x7f58b858249d in g_malloc0 (/lib64/libglib-2.0.so.0+0x5249d)
    #2 0x5562cc627f49 in virtio_add_queue /mnt/sdb/qemu/hw/virtio/virtio.c:2413
    #3 0x5562cc4b524a in virtio_blk_device_realize /mnt/sdb/qemu/hw/block/virtio-blk.c:1202
    #4 0x5562cc613050 in virtio_device_realize /mnt/sdb/qemu/hw/virtio/virtio.c:3615
    #5 0x5562ccb7a568 in device_set_realized /mnt/sdb/qemu/hw/core/qdev.c:891
    #6 0x5562cd39cd45 in property_set_bool /mnt/sdb/qemu/qom/object.c:2238

Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Pan Nengyuan <pannengyuan@huawei.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <20200328005705.29898-2-pannengyuan@huawei.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2020-03-29 09:52:13 -04:00
..
dataplane xen-bus/block: explicitly assign event channels to an AioContext 2020-02-27 11:50:30 +00:00
block.c pflash: Require backend size to match device, improve errors 2019-03-26 08:16:24 +01:00
cdrom.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
ecc.c Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
fdc.c fdc/i8257: implement verify transfer mode 2020-03-27 14:30:08 -04:00
hd-geometry.c block: Remove blk_pread_unthrottled() 2019-08-16 10:25:16 +02:00
Kconfig hw/m68k: add a dummy SWIM floppy controller 2019-10-28 19:06:51 +01:00
m25p80.c m25p80: Improve command handling for unsupported commands 2020-03-17 11:36:42 +00:00
Makefile.objs hw/*/Makefile.objs: Move many .o files to common-objs 2020-02-04 09:00:57 +01:00
nand.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
nvme.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
nvme.h nvme: add Get/Set Feature Timestamp support 2019-06-04 15:22:09 +02:00
onenand.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
pflash_cfi01.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
pflash_cfi02.c hw/block/pflash_cfi02: Remove unneeded variable assignment 2020-02-18 20:20:49 +01:00
swim.c qdev: set properties with device_class_set_props() 2020-01-24 20:59:15 +01:00
tc58128.c Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
trace-events nvme: Print 'cqid' for nvme_del_cq 2020-03-27 14:47:23 +01:00
vhost-user-blk.c vhost-user-blk: convert to new virtio_delete_queue 2020-02-25 08:32:56 -05:00
virtio-blk.c virtio-blk: delete vqs on the error path in realize() 2020-03-29 09:52:13 -04:00
xen_blkif.h xen: Import other xen/io/*.h 2019-06-24 10:42:30 +01:00
xen-block.c xen-block: Use one Error * variable instead of two 2020-03-17 17:29:31 +01:00