diff mbox series

[PULL,17/53] spapr: Fixes a leak in CAS

Message ID 20191004093747.31350-18-david@gibson.dropbear.id.au (mailing list archive)
State New, archived
Headers show
Series [PULL,01/53] pseries: do not allow memory-less/cpu-less NUMA node | expand

Commit Message

David Gibson Oct. 4, 2019, 9:37 a.m. UTC
From: Alexey Kardashevskiy <aik@ozlabs.ru>

Add a missing g_free(fdt) if the resulting tree is bigger
than the space allocated by SLOF.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Greg Kurz <groug@kaod.org>
Reviewed-by: CĂ©dric Le Goater <clg@kaod.org>
---
 hw/ppc/spapr.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 7c3a443776..c69c034183 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1026,6 +1026,7 @@  int spapr_h_cas_compose_response(SpaprMachineState *spapr,
     _FDT((fdt_pack(fdt)));
 
     if (fdt_totalsize(fdt) + sizeof(hdr) > size) {
+        g_free(fdt);
         trace_spapr_cas_failed(size);
         return -1;
     }