[PATCH 0/3]hw: Fixs memleak of fdevice tree blob

kuhn.chenqun@huawei.com posted 3 patches 5 years, 8 months ago
Test docker-quick@centos7 passed
Test FreeBSD passed
Test docker-mingw@fedora passed
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200218091154.21696-1-kuhn.chenqun@huawei.com
Maintainers: Max Filippov <jcmvbkbc@gmail.com>, David Gibson <david@gibson.dropbear.id.au>, Marek Vasut <marex@denx.de>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, Chris Wulff <crwulff@gmail.com>
hw/nios2/boot.c       | 1 +
hw/ppc/virtex_ml507.c | 1 +
hw/xtensa/xtfpga.c    | 1 +
3 files changed, 3 insertions(+)
[PATCH 0/3]hw: Fixs memleak of fdevice tree blob
Posted by kuhn.chenqun@huawei.com 5 years, 8 months ago
From: Chen Qun <kuhn.chenqun@huawei.com>

The device tree blob returned by load_device_tree is malloced.
We should free it after cpu_physical_memory_write().Otherwise,
if we repeatedly call 'system_reset',it will repeatedly load fdt,
so there are many memleaks.

Paolo Bonzini :
https://lists.gnu.org/archive/html/qemu-devel/2019-10/msg00129.html

Pan Nengyuan:
https://lists.gnu.org/archive/html/qemu-devel/2020-02/msg03594.html

After searching the device code, I found three similar issues.
This series fixes the last three.

Chen Qun (3):
  hw/nios2:fix leak of fdevice tree blob
  hw/ppc/virtex_ml507:fix leak of fdevice tree blob
  hw/xtensa/xtfpga:fix leak of fdevice tree blob

 hw/nios2/boot.c       | 1 +
 hw/ppc/virtex_ml507.c | 1 +
 hw/xtensa/xtfpga.c    | 1 +
 3 files changed, 3 insertions(+)

-- 
2.23.0



RE: [PATCH 0/3]hw: Fixs memleak of fdevice tree blob
Posted by Chenqun (kuhn) 5 years, 8 months ago

>-----Original Message-----
>From: Chenqun (kuhn)
>Sent: Tuesday, February 18, 2020 5:12 PM
>To: qemu-devel@nongnu.org; qemu-ppc@nongnu.org; jcmvbkbc@gmail.com;
>crwulff@gmail.com; marex@denx.de; edgar.iglesias@gmail.com;
>david@gibson.dropbear.id.au
>Cc: Zhanghailiang <zhang.zhanghailiang@huawei.com>; qemu-
>trivial@nongnu.org; pbonzini@redhat.com; Pannengyuan
><pannengyuan@huawei.com>; Chenqun (kuhn)
><kuhn.chenqun@huawei.com>
>Subject: [PATCH 0/3]hw: Fixs memleak of fdevice tree blob
>
>From: Chen Qun <kuhn.chenqun@huawei.com>
>
Hi all, after reviewing various patches from Pan Nengyuan fix ppc-e500
fdt memleaks, I search for related content and found Paolo Bonzini's
similarly patchs. (sorry, this description is missing here because of this patch format.)

>The device tree blob returned by load_device_tree is malloced.
>We should free it after cpu_physical_memory_write().Otherwise,
>if we repeatedly call 'system_reset',it will repeatedly load fdt, so there are
>many memleaks.
>
>Paolo Bonzini :
>https://lists.gnu.org/archive/html/qemu-devel/2019-10/msg00129.html
>
>Pan Nengyuan:
>https://lists.gnu.org/archive/html/qemu-devel/2020-02/msg03594.html
>
>After searching the device code, I found three similar issues.
>This series fixes the last three.
>
>Chen Qun (3):
>  hw/nios2:fix leak of fdevice tree blob
>  hw/ppc/virtex_ml507:fix leak of fdevice tree blob
>  hw/xtensa/xtfpga:fix leak of fdevice tree blob
>
> hw/nios2/boot.c       | 1 +
> hw/ppc/virtex_ml507.c | 1 +
> hw/xtensa/xtfpga.c    | 1 +
> 3 files changed, 3 insertions(+)
>
>--
>2.23.0
>