hw/block/nvme: destroy request iov before reuse
Make sure the request iov is destroyed before reuse; fixing a memory leak. Signed-off-by: Klaus Jensen <k.jensen@samsung.com> Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com> Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
This commit is contained in:
parent
13b4463d8b
commit
f06a6aa964
@ -569,6 +569,10 @@ static void nvme_rw_cb(void *opaque, int ret)
|
||||
if (req->qsg.nalloc) {
|
||||
qemu_sglist_destroy(&req->qsg);
|
||||
}
|
||||
if (req->iov.nalloc) {
|
||||
qemu_iovec_destroy(&req->iov);
|
||||
}
|
||||
|
||||
nvme_enqueue_req_completion(cq, req);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user