[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 3/3] hw/xtensa/xtfpga:fix leak of fdevice tree blob
From: |
Laurent Vivier |
Subject: |
Re: [PATCH 3/3] hw/xtensa/xtfpga:fix leak of fdevice tree blob |
Date: |
Wed, 19 Feb 2020 10:30:12 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 |
Le 18/02/2020 à 10:11, address@hidden a écrit :
> 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/xtensa/xtfpga.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c
> index 8e2dd1327a..60ccc74f5f 100644
> --- a/hw/xtensa/xtfpga.c
> +++ b/hw/xtensa/xtfpga.c
> @@ -380,6 +380,7 @@ static void xtfpga_init(const XtfpgaBoardDesc *board,
> MachineState *machine)
> cur_tagptr = put_tag(cur_tagptr, BP_TAG_FDT,
> sizeof(dtb_addr), &dtb_addr);
> cur_lowmem = QEMU_ALIGN_UP(cur_lowmem + fdt_size, 4 * KiB);
> + g_free(fdt);
> }
> #else
> if (dtb_filename) {
>
Reviewed-by: Laurent Vivier <address@hidden>