From: Cornelia Huck <cohuck@redhat.com>
To: Thomas Huth <thuth@redhat.com>,
qemu-s390x@nongnu.org, Matthew Rosato <mjrosato@linux.ibm.com>,
Farhan Ali <alifm@linux.ibm.com>
Cc: qemu-devel@nongnu.org, Eric Farman <farman@linux.ibm.com>,
Halil Pasic <pasic@linux.ibm.com>
Subject: Re: [PATCH v2] hw/s390x: Fix memory leaks after removing elements with QTAILQ_REMOVE
Date: Fri, 29 May 2026 15:58:55 +0200 [thread overview]
Message-ID: <87cxyemi5c.fsf@redhat.com> (raw)
In-Reply-To: <20260511063825.53633-1-thuth@redhat.com>
On Mon, May 11 2026, Thomas Huth <thuth@redhat.com> wrote:
> From: Thomas Huth <thuth@redhat.com>
>
> The elements that get removed with QTAILQ_REMOVE are never referenced
> afterwards anymore, so the corresponding memory should get freed.
>
> Fixes: 37fa32de70 ("s390x/pci: Honor DMA limits set by vfio")
> Reviewed-by: Farhan Ali <alifm@linux.ibm.com>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
> v2: Drop change to hw/s390x/s390-pci-bus.c (since it needs other rework)
>
> hw/s390x/s390-pci-vfio.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/hw/s390x/s390-pci-vfio.c b/hw/s390x/s390-pci-vfio.c
> index 7c754b656da..db6de00bd28 100644
> --- a/hw/s390x/s390-pci-vfio.c
> +++ b/hw/s390x/s390-pci-vfio.c
> @@ -101,6 +101,7 @@ void s390_pci_end_dma_count(S390pciState *s, S390PCIDMACount *cnt)
> cnt->users--;
> if (cnt->users == 0) {
> QTAILQ_REMOVE(&s->zpci_dma_limit, cnt, link);
> + g_free(cnt);
> }
> }
>
Thanks, queued to s390-next.
prev parent reply other threads:[~2026-05-29 13:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-11 6:38 [PATCH v2] hw/s390x: Fix memory leaks after removing elements with QTAILQ_REMOVE Thomas Huth
2026-05-11 14:05 ` Matthew Rosato
2026-05-29 13:58 ` Cornelia Huck [this message]
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=87cxyemi5c.fsf@redhat.com \
--to=cohuck@redhat.com \
--cc=alifm@linux.ibm.com \
--cc=farman@linux.ibm.com \
--cc=mjrosato@linux.ibm.com \
--cc=pasic@linux.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=thuth@redhat.com \
/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.