[PATCH] xilinx: zynqmp: Free allocated field for target variable

Michal Simek monstr at monstr.eu
Fri Aug 6 09:25:15 CEST 2021


st 28. 7. 2021 v 12:48 odesílatel Michal Simek <michal.simek at xilinx.com> napsal:
>
> When env_set() is called there is no need to allocate memory for variable
> which is already saved that's why free it.
>
> Signed-off-by: Michal Simek <michal.simek at xilinx.com>
> ---
>
>  board/xilinx/zynqmp/zynqmp.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
> index 38c910fa5bab..2cb97f42bec3 100644
> --- a/board/xilinx/zynqmp/zynqmp.c
> +++ b/board/xilinx/zynqmp/zynqmp.c
> @@ -735,6 +735,7 @@ int board_late_init(void)
>                         env_targets ? env_targets : "");
>
>         env_set("boot_targets", new_targets);
> +       free(new_targets);
>
>         reset_reason();
>
> --
> 2.32.0
>

Applied.
M

-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs


More information about the U-Boot mailing list