lkml.org 
[lkml]   [2020]   [Dec]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v13 5/6] arm64: Free DTB buffer if fdt_open_into() fails
Date

Lakshmi Ramasubramanian <nramas@linux.microsoft.com> writes:

> create_dtb() function allocates memory for the device tree blob (DTB)
> and calls fdt_open_into(). If this call fails the memory allocated
> for the DTB is not freed before returning from create_dtb() thereby
> leaking memory.
>
> Call vfree() to free the memory allocated for the DTB if fdt_open_into()
> fails.
>
> Co-developed-by: Prakhar Srivastava <prsriva@linux.microsoft.com>
> Signed-off-by: Prakhar Srivastava <prsriva@linux.microsoft.com>
> Signed-off-by: Lakshmi Ramasubramanian <nramas@linux.microsoft.com>
> ---
> arch/arm64/kernel/machine_kexec_file.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)

Reviewed-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>

--
Thiago Jung Bauermann
IBM Linux Technology Center

\
 
 \ /
  Last update: 2020-12-23 02:13    [W:0.180 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site