summary refs log tree commit diff stats
path: root/hw/core/generic-loader.c
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2018-08-16 14:05:28 +0100
committerPeter Maydell <peter.maydell@linaro.org>2018-08-16 14:05:28 +0100
commite7f59933548097dbb2272c49f2e0a4ece92697ff (patch)
tree95086f59e1cd56e347a81e863c4c4e8507c43b98 /hw/core/generic-loader.c
parent191776b96a381b5d2b8d3f90c1c02b3e4779e5f7 (diff)
downloadfocaccia-qemu-e7f59933548097dbb2272c49f2e0a4ece92697ff.tar.gz
focaccia-qemu-e7f59933548097dbb2272c49f2e0a4ece92697ff.zip
loader: extract rom_free() function
The next patch will need to free a rom.  There is already code to do
this in rom_add_file().

Note that rom_add_file() uses:

  rom = g_malloc0(sizeof(*rom));
  ...
  if (rom->fw_dir) {
      g_free(rom->fw_dir);
      g_free(rom->fw_file);
  }

The conditional is unnecessary since g_free(NULL) is a no-op.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20180814162739.11814-4-stefanha@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/core/generic-loader.c')
0 files changed, 0 insertions, 0 deletions