[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 20/20] hw/ppc/virtex_ml507:fix leak of fdevice tree blob
From: |
David Gibson |
Subject: |
[PULL 20/20] hw/ppc/virtex_ml507:fix leak of fdevice tree blob |
Date: |
Fri, 21 Feb 2020 14:36:50 +1100 |
From: Chen Qun <address@hidden>
The device tree blob returned by load_device_tree is malloced.
We should free it after cpu_physical_memory_write().
Reported-by: Euler Robot <address@hidden>
Signed-off-by: Chen Qun <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/ppc/virtex_ml507.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/ppc/virtex_ml507.c b/hw/ppc/virtex_ml507.c
index 91dd00ee91..4eef70069f 100644
--- a/hw/ppc/virtex_ml507.c
+++ b/hw/ppc/virtex_ml507.c
@@ -188,6 +188,7 @@ static int xilinx_load_device_tree(hwaddr addr,
if (r < 0)
fprintf(stderr, "couldn't set /chosen/bootargs\n");
cpu_physical_memory_write(addr, fdt, fdt_size);
+ g_free(fdt);
return fdt_size;
}
--
2.24.1
- Re: [PULL 07/20] spapr: Add NVDIMM device support, (continued)
- [PULL 12/20] pnv/phb3: Add missing break statement, David Gibson, 2020/02/20
- [PULL 10/20] pnv/phb3: Convert 1u to 1ull, David Gibson, 2020/02/20
- [PULL 16/20] target/ppc/cpu.h: Clean up comments in the struct CPUPPCState definition, David Gibson, 2020/02/20
- [PULL 17/20] ppc: free 'fdt' after reset the machine, David Gibson, 2020/02/20
- [PULL 13/20] spapr: Allow changing offset for -kernel image, David Gibson, 2020/02/20
- [PULL 18/20] spapr: Don't use spapr_drc_needed() in CAS code, David Gibson, 2020/02/20
- [PULL 11/20] pnv/phb4: Fix error path in pnv_pec_realize(), David Gibson, 2020/02/20
- [PULL 14/20] target/ppc: Fix typo in comments, David Gibson, 2020/02/20
- [PULL 15/20] target/ppc/cpu.h: Move fpu related members closer in cpu env, David Gibson, 2020/02/20
- [PULL 20/20] hw/ppc/virtex_ml507:fix leak of fdevice tree blob,
David Gibson <=
- [PULL 19/20] spapr: Fix handling of unplugged devices during CAS and migration, David Gibson, 2020/02/20
- Re: [PULL 00/20] ppc-for-5.0 queue 20200221, Peter Maydell, 2020/02/21