From: Chalapathi V Date: Wed, 7 Aug 2024 20:28:04 +0000 (+0200) Subject: hw/ssi/pnv_spi: Fixes Coverity CID 1558831 X-Git-Tag: v9.1.2~27 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2a5eec6dd28c87a054fe02e54844b7fb920d9ede;p=thirdparty%2Fqemu.git hw/ssi/pnv_spi: Fixes Coverity CID 1558831 In this commit the following coverity scan defect has been fixed CID 1558831: Resource leaks (RESOURCE_LEAK) Variable "rsp_payload" going out of scope leaks the storage it points to. Cc: qemu-stable@nongnu.org Fixes: Coverity CID 1558831 Signed-off-by: Chalapathi V Fixes: b4cb930e40 ("hw/ssi: Extend SPI model") [PMD: Rebased on previous commit (returning earlier)] Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Signed-off-by: Nicholas Piggin (cherry picked from commit 031324472eee57bce9bd4a0231aa9b137494d8a1) Signed-off-by: Michael Tokarev --- diff --git a/hw/ssi/pnv_spi.c b/hw/ssi/pnv_spi.c index 05e6afc11ef..eadc36fa86e 100644 --- a/hw/ssi/pnv_spi.c +++ b/hw/ssi/pnv_spi.c @@ -239,6 +239,7 @@ static void transfer(PnvSpi *s, PnvXferBuffer *payload) } } spi_response(s, s->N1_bits, rsp_payload); + pnv_spi_xfer_buffer_free(rsp_payload); } static inline uint8_t get_seq_index(PnvSpi *s)