diff options
author | Stefan Hajnoczi | 2018-08-16 15:05:28 +0200 |
---|---|---|
committer | Peter Maydell | 2018-08-16 15:05:28 +0200 |
commit | e7f59933548097dbb2272c49f2e0a4ece92697ff (patch) | |
tree | 95086f59e1cd56e347a81e863c4c4e8507c43b98 /hw/core/generic-loader.c | |
parent | target/arm: add "cortex-m0" CPU model (diff) | |
download | qemu-e7f59933548097dbb2272c49f2e0a4ece92697ff.tar.gz qemu-e7f59933548097dbb2272c49f2e0a4ece92697ff.tar.xz 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