]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
hw/ppc: use g_free() in spapr_tce_table_post_load()
authorDaniel Henrique Barboza <danielhb413@gmail.com>
Fri, 28 Jul 2023 19:56:45 +0000 (16:56 -0300)
committerMichael Tokarev <mjt@tls.msk.ru>
Fri, 8 Sep 2023 10:08:52 +0000 (13:08 +0300)
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]

hw/ppc/spapr_iommu.c

index 63e34d457a0e96736e05de757d40f23e686d2dd6..5e3973fc5fba30354de3dd285b0d297f7f8b1613 100644 (file)
@@ -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;
     }