mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 02:24:58 -06:00
acpi: cleanup bios_linker_loader_cleanup()
bios_linker_loader_cleanup() is called only from one place and returned value is immediately freed wich makes returning pointer from bios_linker_loader_cleanup() useless. Cleanup bios_linker_loader_cleanup() by freeing data there so that caller won't have to free it. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
ad9671b870
commit
8cc87c3179
3 changed files with 6 additions and 7 deletions
|
@ -121,12 +121,13 @@ BIOSLinker *bios_linker_loader_init(void)
|
|||
return linker;
|
||||
}
|
||||
|
||||
/* Free linker wrapper and return the linker commands array. */
|
||||
void *bios_linker_loader_cleanup(BIOSLinker *linker)
|
||||
/* Free linker wrapper */
|
||||
void bios_linker_loader_cleanup(BIOSLinker *linker)
|
||||
{
|
||||
int i;
|
||||
BiosLinkerFileEntry *entry;
|
||||
void *cmd_blob = g_array_free(linker->cmd_blob, false);
|
||||
|
||||
g_array_free(linker->cmd_blob, true);
|
||||
|
||||
for (i = 0; i < linker->file_list->len; i++) {
|
||||
entry = &g_array_index(linker->file_list, BiosLinkerFileEntry, i);
|
||||
|
@ -134,7 +135,6 @@ void *bios_linker_loader_cleanup(BIOSLinker *linker)
|
|||
}
|
||||
g_array_free(linker->file_list, true);
|
||||
g_free(linker);
|
||||
return cmd_blob;
|
||||
}
|
||||
|
||||
static const BiosLinkerFileEntry *
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue