All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xilinx: zynqmp: Free allocated field for target variable
@ 2021-07-28 10:48 Michal Simek
  2021-08-06  7:25 ` Michal Simek
  0 siblings, 1 reply; 2+ messages in thread
From: Michal Simek @ 2021-07-28 10:48 UTC (permalink / raw)
  To: u-boot, git; +Cc: Ibai Erkiaga, Michal Simek, Simon Glass, T Karthik Reddy

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@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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] xilinx: zynqmp: Free allocated field for target variable
  2021-07-28 10:48 [PATCH] xilinx: zynqmp: Free allocated field for target variable Michal Simek
@ 2021-08-06  7:25 ` Michal Simek
  0 siblings, 0 replies; 2+ messages in thread
From: Michal Simek @ 2021-08-06  7:25 UTC (permalink / raw)
  To: U-Boot, git; +Cc: Ibai Erkiaga, Simon Glass, T Karthik Reddy

st 28. 7. 2021 v 12:48 odesílatel Michal Simek <michal.simek@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@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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-06  7:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-28 10:48 [PATCH] xilinx: zynqmp: Free allocated field for target variable Michal Simek
2021-08-06  7:25 ` Michal Simek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.