]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hw/ssi/pnv_spi: Match _xfer_buffer_free() with _xfer_buffer_new()
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Wed, 7 Aug 2024 20:28:02 +0000 (22:28 +0200)
committerMichael Tokarev <mjt@tls.msk.ru>
Tue, 5 Nov 2024 15:58:08 +0000 (18:58 +0300)
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.

Cc: qemu-stable@nongnu.org
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
(cherry picked from commit 65f53702d2e4bd045ce16ca874469cdd1e1ef4e4)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/ssi/pnv_spi.c

index c1297ab7330667d256a16b189569b3d185dcfd2e..13a47f07e79dccad75dd8e6df8d3765945e8b9cc 100644 (file)
@@ -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,