On 08/03/2019 02.32, Philippe Mathieu-Daudé wrote: > The 'file_data' is allocated by read_splashfile() (introduced in > commit 3d3b8303c6f8). It is then used by fw_cfg_add_file(). Due > to the contract interface of fw_cfg_add_file(), it has to be valid > for the lifetime of the FwCfg object. > > Keep a reference of 'file_data' in FWCfgState to be able to > free this memory in fw_cfg_common_unrealize(). > We can now remove the res_free() from the main() loop. > The global boot_splash_filedata is now unused, remove it. > > Signed-off-by: Philippe Mathieu-Daudé <phi...@redhat.com> > --- > hw/nvram/fw_cfg.c | 10 ++++++---- > include/hw/nvram/fw_cfg.h | 1 + > include/sysemu/sysemu.h | 1 - > vl.c | 9 --------- > 4 files changed, 7 insertions(+), 14 deletions(-)
Reviewed-by: Thomas Huth <th...@redhat.com>