[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 12/25] virtio-blk: fix reference a pointer which mig
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 12/25] virtio-blk: fix reference a pointer which might be freed |
Date: |
Wed, 27 Aug 2014 12:36:09 -0500 |
From: zhanghailiang <address@hidden>
In function virtio_blk_handle_request, it may freed memory pointed by req,
So do not access member of req after calling this function.
Cc: address@hidden
Reviewed-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: zhanghailiang <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
(cherry picked from commit 1bdb176ac5add5dc9d54a230da7511b66851f1e7)
Signed-off-by: Michael Roth <address@hidden>
---
hw/block/virtio-blk.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index c241c50..0e3925b 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -469,8 +469,9 @@ static void virtio_blk_dma_restart_bh(void *opaque)
s->rq = NULL;
while (req) {
+ VirtIOBlockReq *next = req->next;
virtio_blk_handle_request(req, &mrb);
- req = req->next;
+ req = next;
}
virtio_submit_multiwrite(s->bs, &mrb);
--
1.9.1
- [Qemu-devel] [PATCH 04/25] l2tpv3 (configure): it is linux-specific, (continued)
- [Qemu-devel] [PATCH 04/25] l2tpv3 (configure): it is linux-specific, Michael Roth, 2014/08/27
- [Qemu-devel] [PATCH 07/25] hw:i386: typo fix: MEMORY_HOPTLUG_DEVICE -> MEMORY_HOTPLUG_DEVICE, Michael Roth, 2014/08/27
- [Qemu-devel] [PATCH 02/25] qdev-monitor: include QOM properties in -device FOO, help output, Michael Roth, 2014/08/27
- [Qemu-devel] [PATCH 05/25] ide: only constrain read/write requests to drive size, not other types, Michael Roth, 2014/08/27
- [Qemu-devel] [PATCH 08/25] pc-dimm: validate node property, Michael Roth, 2014/08/27
- [Qemu-devel] [PATCH 10/25] numa: show hex number in error message for consistency and prefix them with 0x, Michael Roth, 2014/08/27
- [Qemu-devel] [PATCH 09/25] pc-dimm: fix up error message, Michael Roth, 2014/08/27
- [Qemu-devel] [PATCH 06/25] pci: Use bus master address space for delivering MSI/MSI-X messages, Michael Roth, 2014/08/27
- [Qemu-devel] [PATCH 12/25] virtio-blk: fix reference a pointer which might be freed,
Michael Roth <=
- [Qemu-devel] [PATCH 13/25] target-arm: Fix return address for A64 BRK instructions, Michael Roth, 2014/08/27
- [Qemu-devel] [PATCH 11/25] acpi: align RSDP, Michael Roth, 2014/08/27
- [Qemu-devel] [PATCH 16/25] block/iscsi: fix memory corruption on iscsi resize, Michael Roth, 2014/08/27
- [Qemu-devel] [PATCH 15/25] arm/virt: Use PSCI v0.2 function IDs in the DT when KVM uses PSCI v0.2, Michael Roth, 2014/08/27
- [Qemu-devel] [PATCH 18/25] qemu-iotests: add test case 101 for short file I/O, Michael Roth, 2014/08/27
- [Qemu-devel] [PATCH 01/25] qmp: hide "hotplugged" device property from device-list-properties, Michael Roth, 2014/08/27
- [Qemu-devel] [PATCH 20/25] vmxnet3: Pad short frames to minimum size (60 bytes), Michael Roth, 2014/08/27
- [Qemu-devel] [PATCH 17/25] raw-posix: fix O_DIRECT short reads, Michael Roth, 2014/08/27
- [Qemu-devel] [PATCH 21/25] hostmem: set MPOL_MF_MOVE, Michael Roth, 2014/08/27
- [Qemu-devel] [PATCH 19/25] blkdebug: Delete BH in bdrv_aio_cancel, Michael Roth, 2014/08/27