qemu-trivial
[Top][All Lists]
Advanced

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

[PATCH 1/3] hw/nios2:fix leak of fdevice tree blob


From: kuhn.chenqun
Subject: [PATCH 1/3] hw/nios2:fix leak of fdevice tree blob
Date: Tue, 18 Feb 2020 17:11:52 +0800

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>
---
 hw/nios2/boot.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/nios2/boot.c b/hw/nios2/boot.c
index 46b8349876..88224aa84c 100644
--- a/hw/nios2/boot.c
+++ b/hw/nios2/boot.c
@@ -109,6 +109,7 @@ static int nios2_load_dtb(struct nios2_boot_info bi, const 
uint32_t ramsize,
     }
 
     cpu_physical_memory_write(bi.fdt, fdt, fdt_size);
+    g_free(fdt);
     return fdt_size;
 }
 
-- 
2.23.0





reply via email to

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