All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block: fix leak of block histogram data
@ 2026-10-12 11:43 Daniel P. Berrangé
  2026-10-13 18:58 ` Eric Blake
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel P. Berrangé @ 2026-10-12 11:43 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, qemu-block, Hanna Reitz, Daniel P. Berrangé

The block_acct_cleanup method failed to release memory associated
with block histograms.

Fixes: b741ae7417 (block/accounting: introduce latency histogram)
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 block/accounting.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/block/accounting.c b/block/accounting.c
index 038af370170..40ed70782b4 100644
--- a/block/accounting.c
+++ b/block/accounting.c
@@ -80,6 +80,13 @@ bool block_acct_setup(BlockAcctStats *stats, enum OnOffAuto account_invalid,
 void block_acct_cleanup(BlockAcctStats *stats)
 {
     BlockAcctTimedStats *s, *next;
+    size_t i;
+    for (i = 0; i < BLOCK_MAX_IOTYPE; i++) {
+        BlockLatencyHistogram *hist = &stats->latency_histogram[i];
+        g_free(hist->bins);
+        g_free(hist->boundaries);
+    }
+
     QSLIST_FOREACH_SAFE(s, &stats->intervals, entries, next) {
         g_free(s);
     }
-- 
2.56.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] block: fix leak of block histogram data
  2026-10-12 11:43 [PATCH] block: fix leak of block histogram data Daniel P. Berrangé
@ 2026-10-13 18:58 ` Eric Blake
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Blake @ 2026-10-13 18:58 UTC (permalink / raw)
  To: Daniel P. Berrangé; +Cc: qemu-devel, Kevin Wolf, qemu-block, Hanna Reitz

On Mon, Oct 12, 2026 at 12:43:59PM +0100, Daniel P. Berrangé wrote:
> The block_acct_cleanup method failed to release memory associated
> with block histograms.
> 
> Fixes: b741ae7417 (block/accounting: introduce latency histogram)
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>  block/accounting.c | 7 +++++++
>  1 file changed, 7 insertions(+)

Reviewed-by: Eric Blake <eblake@redhat.com>

> 
> diff --git a/block/accounting.c b/block/accounting.c
> index 038af370170..40ed70782b4 100644
> --- a/block/accounting.c
> +++ b/block/accounting.c
> @@ -80,6 +80,13 @@ bool block_acct_setup(BlockAcctStats *stats, enum OnOffAuto account_invalid,
>  void block_acct_cleanup(BlockAcctStats *stats)
>  {
>      BlockAcctTimedStats *s, *next;
> +    size_t i;
> +    for (i = 0; i < BLOCK_MAX_IOTYPE; i++) {
> +        BlockLatencyHistogram *hist = &stats->latency_histogram[i];
> +        g_free(hist->bins);
> +        g_free(hist->boundaries);
> +    }
> +
>      QSLIST_FOREACH_SAFE(s, &stats->intervals, entries, next) {
>          g_free(s);
>      }
> -- 
> 2.56.0
> 
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization:  qemu.org | libguestfs.org



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-13 18:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-12 11:43 [PATCH] block: fix leak of block histogram data Daniel P. Berrangé
2026-10-13 18:58 ` Eric Blake

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.