From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:55212) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2Cmr-0006ay-Os for qemu-devel@nongnu.org; Fri, 08 Mar 2019 05:31:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h2Cmp-0002jz-CV for qemu-devel@nongnu.org; Fri, 08 Mar 2019 05:31:33 -0500 References: <20190308013222.12524-1-philmd@redhat.com> <20190308013222.12524-10-philmd@redhat.com> From: Laszlo Ersek Message-ID: <9a4ee1fd-25ec-6113-496a-c5c4f51435f2@redhat.com> Date: Fri, 8 Mar 2019 11:31:12 +0100 MIME-Version: 1.0 In-Reply-To: <20190308013222.12524-10-philmd@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 09/18] hw/nvram/fw_cfg: Free file_slots in common_unrealize() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= , Gerd Hoffmann , "Michael S. Tsirkin" , qemu-devel@nongnu.org Cc: Marcel Apfelbaum , Eduardo Habkost , Paolo Bonzini , Richard Henderson , Artyom Tarasenko , "Dr. David Alan Gilbert" , Peter Maydell , David Gibson , Igor Mammedov , Eric Blake , qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Markus Armbruster , Mark Cave-Ayland , Thomas Huth , "Daniel P . Berrange" On 03/08/19 02:32, Philippe Mathieu-Daud=C3=A9 wrote: > Called by fw_cfg_common_realize(), fw_cfg_file_slots_allocate() > allocates various buffers. > Free them in fw_cfg_common_unrealize(). >=20 > Signed-off-by: Philippe Mathieu-Daud=C3=A9 > --- > hw/nvram/fw_cfg.c | 4 ++++ > 1 file changed, 4 insertions(+) >=20 > diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c > index ca58d279a4..b73a591eff 100644 > --- a/hw/nvram/fw_cfg.c > +++ b/hw/nvram/fw_cfg.c > @@ -971,6 +971,10 @@ static void fw_cfg_common_unrealize(DeviceState *d= ev, Error **errp) > FWCfgState *s =3D FW_CFG(dev); > =20 > g_free(s->files); > + > + g_free(s->entries[0]); > + g_free(s->entries[1]); > + g_free(s->entry_order); > } > =20 > FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint32_t dma_iobase, >=20 Reviewed-by: Laszlo Ersek