Skip to content

Commit

Permalink
hw/ppc: use g_free() in spapr_tce_table_post_load()
Browse files Browse the repository at this point in the history
tcet->mig_table is copied from tcet->table, which in turn is created
in spapr_tce_alloc_table() using g_new0().

Use g_free() instead of free() to deallocate it.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
[Mjt: fix commit comments]
  • Loading branch information
danielhb authored and Michael Tokarev committed Sep 8, 2023
1 parent ded625e commit 44adcaa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hw/ppc/spapr_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ static int spapr_tce_table_post_load(void *opaque, int version_id)
memcpy(tcet->table, tcet->mig_table,
tcet->nb_table * sizeof(tcet->table[0]));

free(tcet->mig_table);
g_free(tcet->mig_table);
tcet->mig_table = NULL;
}

Expand Down

0 comments on commit 44adcaa

Please sign in to comment.