Commit 7a34f7b879 for qemu.org

commit 7a34f7b8794b29cd1bd4dfa45f7d8e8daba7cff5
Author: Klaus Jensen <k.jensen@samsung.com>
Date:   Fri Jul 31 11:21:33 2026 +0200

    hw/nvme: fix leak on copy ranges

    The buffer holding the ranges for the copy command is not correctly
    deallocated.

    Fix this.

    Cc: qemu-stable@nongnu.org
    Link: https://gitlab.com/qemu-project/qemu/-/work_items/4072
    Fixes: 796d20681d9b ("hw/nvme: reimplement the copy command to allow aio cancellation")
    Reviewed-by: Jesper Wendel Devantier <foss@defmacro.it>
    Signed-off-by: Klaus Jensen <k.jensen@samsung.com>

diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c
index 8461b6fbde..4893cf7e74 100644
--- a/hw/nvme/ctrl.c
+++ b/hw/nvme/ctrl.c
@@ -2811,6 +2811,7 @@ static void nvme_copy_done(NvmeCopyAIOCB *iocb)

     qemu_iovec_destroy(&iocb->iov);
     g_free(iocb->bounce);
+    g_free(iocb->ranges);

     if (iocb->ret < 0) {
         block_acct_failed(stats, &iocb->acct.read);