qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Shivang Upadhyay <shivangu@linux.ibm.com>
To: peter.maydell@linaro.org
Cc: adityag@linux.ibm.com, harshpb@linux.ibm.com,
	qemu-devel@nongnu.org, shivangu@linux.ibm.com,
	sourabhjain@linux.ibm.com
Subject: [PATCH 2/2] hw/ppc: Fix memory leak in get_cpu_state_data()
Date: Tue, 28 Oct 2025 12:28:15 +0530	[thread overview]
Message-ID: <20251028065815.84156-2-shivangu@linux.ibm.com> (raw)
In-Reply-To: <20251028065815.84156-1-shivangu@linux.ibm.com>

Fixes coverity (CID 1642024)

Cc: Aditya Gupta <adityag@linux.ibm.com>
Cc: Harsh Prateek Bora <harshpb@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/CAFEAcA_Bm52bkPi9MH_uugXRR5fj48RtpbOnPNFQtbX=7Mz_yw@mail.gmail.com/
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Shivang Upadhyay <shivangu@linux.ibm.com>
---
 hw/ppc/spapr_fadump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/ppc/spapr_fadump.c b/hw/ppc/spapr_fadump.c
index 883a60cdcf..49d2f862a1 100644
--- a/hw/ppc/spapr_fadump.c
+++ b/hw/ppc/spapr_fadump.c
@@ -453,7 +453,7 @@ static FadumpRegEntry *populate_cpu_reg_entries(CPUState *cpu,
 static void *get_cpu_state_data(uint64_t *cpu_state_len)
 {
     FadumpRegSaveAreaHeader reg_save_hdr;
-    FadumpRegEntry *reg_entries;
+    g_autofree FadumpRegEntry *reg_entries;
     FadumpRegEntry *curr_reg_entry;
     CPUState *cpu;
 
-- 
2.51.0



  reply	other threads:[~2025-10-28  6:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-28  6:58 [PATCH 1/2] hw/ppc: Fix missing return on allocation failure Shivang Upadhyay
2025-10-28  6:58 ` Shivang Upadhyay [this message]
2025-10-28  7:12   ` [PATCH 2/2] hw/ppc: Fix memory leak in get_cpu_state_data() Philippe Mathieu-Daudé
2025-10-28  7:30     ` Philippe Mathieu-Daudé
2025-10-28  7:36       ` Shivang Upadhyay

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=20251028065815.84156-2-shivangu@linux.ibm.com \
    --to=shivangu@linux.ibm.com \
    --cc=adityag@linux.ibm.com \
    --cc=harshpb@linux.ibm.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=sourabhjain@linux.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).