From: Richard Henderson <richard.henderson@linaro.org>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>, 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>
Subject: Re: [PATCH-for-9.1 v2 2/4] hw/ssi/pnv_spi: Match _xfer_buffer_free() with _xfer_buffer_new()
Date: Thu, 8 Aug 2024 09:44:58 +1000 [thread overview]
Message-ID: <68f20670-d6a7-4b1c-b1a5-971391739055@linaro.org> (raw)
In-Reply-To: <20240807202804.56038-3-philmd@linaro.org>
On 8/8/24 06:28, Philippe Mathieu-Daudé wrote:
> 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,
g_free/free are supposed to be interchangeable in this epoch.
But
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
next prev parent reply other threads:[~2024-08-07 23:45 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 ` [PATCH-for-9.1 v2 2/4] hw/ssi/pnv_spi: Match _xfer_buffer_free() with _xfer_buffer_new() Philippe Mathieu-Daudé
2024-08-07 23:44 ` Richard Henderson [this message]
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=68f20670-d6a7-4b1c-b1a5-971391739055@linaro.org \
--to=richard.henderson@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=philmd@linaro.org \
--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).