qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH for-8.2 1/2] hw/ppc: use g_free() in spapr_tce_table_post_load()


From: Daniel Henrique Barboza
Subject: [PATCH for-8.2 1/2] hw/ppc: use g_free() in spapr_tce_table_post_load()
Date: Fri, 28 Jul 2023 16:56:45 -0300

tcet->mig_table is memcpy'ed from tcet->table, which in turn is created
via spapr_tce_alloc_table().

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

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
---
 hw/ppc/spapr_iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/ppc/spapr_iommu.c b/hw/ppc/spapr_iommu.c
index 63e34d457a..5e3973fc5f 100644
--- a/hw/ppc/spapr_iommu.c
+++ b/hw/ppc/spapr_iommu.c
@@ -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;
     }
 
-- 
2.41.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]