mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-07-08 20:17:27 +00:00
virtio-blk: fix reference a pointer which might be freed
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: qemu-stable@nongnu.org Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
466560b9fc
commit
1bdb176ac5
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user