From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Nicholas Piggin" <npiggin@gmail.com>,
"Glenn Miles" <milesg@linux.ibm.com>,
"Caleb Schlossin" <calebs@linux.vnet.ibm.com>,
qemu-ppc@nongnu.org, "Frédéric Barrat" <fbarrat@linux.ibm.com>,
"Alistair Francis" <alistair@alistair23.me>,
"Cédric Le Goater" <clg@kaod.org>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PATCH-for-9.1 v2 2/4] hw/ssi/pnv_spi: Match _xfer_buffer_free() with _xfer_buffer_new()
Date: Wed, 7 Aug 2024 22:28:02 +0200 [thread overview]
Message-ID: <20240807202804.56038-3-philmd@linaro.org> (raw)
In-Reply-To: <20240807202804.56038-1-philmd@linaro.org>
pnv_spi_xfer_buffer_new() allocates %payload using g_malloc0(),
and pnv_spi_xfer_buffer_write_ptr() allocates %payload->data
using g_realloc(). Use the API equivalent g_free() to release
the buffers.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/ssi/pnv_spi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/ssi/pnv_spi.c b/hw/ssi/pnv_spi.c
index c1297ab733..13a47f07e7 100644
--- a/hw/ssi/pnv_spi.c
+++ b/hw/ssi/pnv_spi.c
@@ -53,8 +53,8 @@ static PnvXferBuffer *pnv_spi_xfer_buffer_new(void)
static void pnv_spi_xfer_buffer_free(PnvXferBuffer *payload)
{
- free(payload->data);
- free(payload);
+ g_free(payload->data);
+ g_free(payload);
}
static uint8_t *pnv_spi_xfer_buffer_write_ptr(PnvXferBuffer *payload,
--
2.45.2
next prev parent reply other threads:[~2024-08-07 20:29 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-07 20:28 [PATCH-for-9.1 v2 0/4] hw/ssi/pnv_spi: Fixes Coverity CID 1558831 Philippe Mathieu-Daudé
2024-08-07 20:28 ` [PATCH-for-9.1 v2 1/4] MAINTAINERS: Cover PowerPC SPI model in PowerNV section Philippe Mathieu-Daudé
2024-08-07 20:28 ` Philippe Mathieu-Daudé [this message]
2024-08-07 23:44 ` [PATCH-for-9.1 v2 2/4] hw/ssi/pnv_spi: Match _xfer_buffer_free() with _xfer_buffer_new() Richard Henderson
2024-08-07 20:28 ` [PATCH-for-9.1 v2 3/4] hw/ssi/pnv_spi: Return early in transfer() Philippe Mathieu-Daudé
2024-08-07 23:42 ` Richard Henderson
2024-08-07 20:28 ` [PATCH-for-9.1 v2 4/4] hw/ssi/pnv_spi: Fixes Coverity CID 1558831 Philippe Mathieu-Daudé
2024-08-07 20:28 ` Philippe Mathieu-Daudé
2024-08-07 23:45 ` Richard Henderson
2024-09-12 16:55 ` [PATCH-for-9.1 v2 0/4] " Cédric Le Goater
2024-09-13 13:24 ` Chalapathi V
2024-09-13 13:37 ` Cédric Le Goater
2024-09-16 10:04 ` Chalapathi V
2024-11-04 5:51 ` Nicholas Piggin
2024-11-04 11:21 ` Philippe Mathieu-Daudé
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=20240807202804.56038-3-philmd@linaro.org \
--to=philmd@linaro.org \
--cc=alistair@alistair23.me \
--cc=calebs@linux.vnet.ibm.com \
--cc=clg@kaod.org \
--cc=fbarrat@linux.ibm.com \
--cc=milesg@linux.ibm.com \
--cc=npiggin@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@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 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).