[PATCH v2 0/9] arm (and others): fix some memory leaks

Peter Maydell posted 9 patches 1 month, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260302092225.4088227-1-peter.maydell@linaro.org
Maintainers: "Alex Bennée" <alex.bennee@linaro.org>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Thomas Huth <thuth@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, "Cédric Le Goater" <clg@kaod.org>, Peter Maydell <peter.maydell@linaro.org>, Steven Lee <steven_lee@aspeedtech.com>, Troy Lee <leetroy@gmail.com>, Jamin Lin <jamin_lin@aspeedtech.com>, Andrew Jeffery <andrew@codeconstruct.com.au>, Joel Stanley <joel@jms.id.au>, Alexander Bulekov <alxndr@bu.edu>, Stefan Hajnoczi <stefanha@redhat.com>, Fabiano Rosas <farosas@suse.de>, Darren Kenny <darren.kenny@oracle.com>, Qiuhao Li <Qiuhao.Li@outlook.com>, Eric Auger <eric.auger@redhat.com>, Laurent Vivier <lvivier@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
.gitlab-ci.d/buildtest.yml             |  2 +-
chardev/char-io.c                      |  5 ++++
chardev/char-socket.c                  | 34 ++++++------------------
hw/gpio/aspeed_gpio.c                  |  2 +-
scripts/lsan_suppressions.txt          | 26 +++++++++++++++++++
scripts/oss-fuzz/lsan_suppressions.txt |  5 ----
tests/docker/test-fuzz                 |  2 +-
tests/qtest/iommu-smmuv3-test.c        |  1 +
tests/qtest/qos-test.c                 | 36 +++++++++++++++++++-------
tests/qtest/test-x86-cpuid-compat.c    |  4 +++
10 files changed, 73 insertions(+), 44 deletions(-)
create mode 100644 scripts/lsan_suppressions.txt
delete mode 100644 scripts/oss-fuzz/lsan_suppressions.txt
[PATCH v2 0/9] arm (and others): fix some memory leaks
Posted by Peter Maydell 1 month, 1 week ago
This patchset fixes a couple of minor memory leaks I found by running
"make check" for the arm targets with the clang leak sanitizer enabled.
Version 2 also includes some patches by Fabiano from last year that
fell through the cracks; I've rebased them and included them here.

Changes in v2:
 * patch 1 now just moves the file to keep 'git log --follow' happy
 * patch 1 fixes the filename in tests/docker/test-fuzz
 * patch 2 has the SPDX/doc comment that were in patch 1 before
 * patch 2 drops the walk_path suppression as one of Fabiano's
   patches fixes this leak properly
 * patches 5-9 are from Fabiano; most were reviewed last year

Patches still needing review: just patch 1.

thanks
-- PMM

Fabiano Rosas (5):
  chardev: Fix QIOChannel refcount
  chardev: Don't attempt to unregister yank function more than once
  chardev: Consolidate yank registration
  tests/qtest/test-x86-cpuid-compat: Free allocated memory
  tests/qtest/qos-test: Plug a couple of leaks

Peter Maydell (4):
  scripts: Move lsan_suppressions.txt out of oss-fuzz subdir
  scripts/lsan_suppressions.txt: Add more leaks
  hw/arm/aspeed_gpio: Don't leak string in aspeed_gpio_init()
  tests/qtest/iommu-smmuv3-test: Free QPCIDevice

 .gitlab-ci.d/buildtest.yml             |  2 +-
 chardev/char-io.c                      |  5 ++++
 chardev/char-socket.c                  | 34 ++++++------------------
 hw/gpio/aspeed_gpio.c                  |  2 +-
 scripts/lsan_suppressions.txt          | 26 +++++++++++++++++++
 scripts/oss-fuzz/lsan_suppressions.txt |  5 ----
 tests/docker/test-fuzz                 |  2 +-
 tests/qtest/iommu-smmuv3-test.c        |  1 +
 tests/qtest/qos-test.c                 | 36 +++++++++++++++++++-------
 tests/qtest/test-x86-cpuid-compat.c    |  4 +++
 10 files changed, 73 insertions(+), 44 deletions(-)
 create mode 100644 scripts/lsan_suppressions.txt
 delete mode 100644 scripts/oss-fuzz/lsan_suppressions.txt

-- 
2.43.0
Re: [PATCH v2 0/9] arm (and others): fix some memory leaks
Posted by Peter Maydell 1 month, 1 week ago
Since these patches have all been reviewed, I'm going to take
them into target-arm.next. Let me know if you'd prefer something
else or if anybody wants more time to review.

thanks
-- PMM

On Mon, 2 Mar 2026 at 09:22, Peter Maydell <peter.maydell@linaro.org> wrote:
>
> This patchset fixes a couple of minor memory leaks I found by running
> "make check" for the arm targets with the clang leak sanitizer enabled.
> Version 2 also includes some patches by Fabiano from last year that
> fell through the cracks; I've rebased them and included them here.
>
> Changes in v2:
>  * patch 1 now just moves the file to keep 'git log --follow' happy
>  * patch 1 fixes the filename in tests/docker/test-fuzz
>  * patch 2 has the SPDX/doc comment that were in patch 1 before
>  * patch 2 drops the walk_path suppression as one of Fabiano's
>    patches fixes this leak properly
>  * patches 5-9 are from Fabiano; most were reviewed last year
>
> Patches still needing review: just patch 1.
>
> thanks
> -- PMM
>
> Fabiano Rosas (5):
>   chardev: Fix QIOChannel refcount
>   chardev: Don't attempt to unregister yank function more than once
>   chardev: Consolidate yank registration
>   tests/qtest/test-x86-cpuid-compat: Free allocated memory
>   tests/qtest/qos-test: Plug a couple of leaks
>
> Peter Maydell (4):
>   scripts: Move lsan_suppressions.txt out of oss-fuzz subdir
>   scripts/lsan_suppressions.txt: Add more leaks
>   hw/arm/aspeed_gpio: Don't leak string in aspeed_gpio_init()
>   tests/qtest/iommu-smmuv3-test: Free QPCIDevice
>
>  .gitlab-ci.d/buildtest.yml             |  2 +-
>  chardev/char-io.c                      |  5 ++++
>  chardev/char-socket.c                  | 34 ++++++------------------
>  hw/gpio/aspeed_gpio.c                  |  2 +-
>  scripts/lsan_suppressions.txt          | 26 +++++++++++++++++++
>  scripts/oss-fuzz/lsan_suppressions.txt |  5 ----
>  tests/docker/test-fuzz                 |  2 +-
>  tests/qtest/iommu-smmuv3-test.c        |  1 +
>  tests/qtest/qos-test.c                 | 36 +++++++++++++++++++-------
>  tests/qtest/test-x86-cpuid-compat.c    |  4 +++
>  10 files changed, 73 insertions(+), 44 deletions(-)
>  create mode 100644 scripts/lsan_suppressions.txt
>  delete mode 100644 scripts/oss-fuzz/lsan_suppressions.txt