All of lore.kernel.org
 help / color / mirror / Atom feed
From: Klaus Jensen <its@irrelevant.dk>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Klaus Jensen <k.jensen@samsung.com>,
	qemu-stable@nongnu.org,
	Jesper Wendel Devantier <foss@defmacro.it>,
	Keith Busch <kbusch@kernel.org>, Klaus Jensen <its@irrelevant.dk>,
	qemu-block@nongnu.org
Subject: [PULL 4/4] hw/nvme: fix leak on copy ranges
Date: Mon,  3 Aug 2026 15:44:35 -0700	[thread overview]
Message-ID: <20260803224436.38768-5-its@irrelevant.dk> (raw)
In-Reply-To: <20260803224436.38768-1-its@irrelevant.dk>

From: Klaus Jensen <k.jensen@samsung.com>

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>
---
 hw/nvme/ctrl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c
index 8461b6fbdeae..4893cf7e7418 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);
-- 
2.53.0



  parent reply	other threads:[~2026-08-03 22:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-03 22:44 [PULL 0/4] hw/nvme queue Klaus Jensen
2026-08-03 22:44 ` [PULL 1/4] hw/nvme: drop AER requests without aiocb in nvme_del_sq() Klaus Jensen
2026-08-03 22:44 ` [PULL 2/4] hw/nvme: factor out nvme_sq_cancel_inflight() Klaus Jensen
2026-08-03 22:44 ` [PULL 3/4] hw/nvme: cancel inflight requests on controller reset Klaus Jensen
2026-08-03 22:44 ` Klaus Jensen [this message]
2026-08-05  0:54 ` [PULL 0/4] hw/nvme queue Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260803224436.38768-5-its@irrelevant.dk \
    --to=its@irrelevant.dk \
    --cc=foss@defmacro.it \
    --cc=k.jensen@samsung.com \
    --cc=kbusch@kernel.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.