Content-Type: multipart/mixed; boundary="===============5468598607219636404==" MIME-Version: 1.0 From: Lakshmi Ramasubramanian To: kbuild-all@lists.01.org Subject: Re: [PATCH] powerpc: Initialize local variable fdt to NULL in elf64_load() Date: Thu, 15 Apr 2021 12:18:39 -0700 Message-ID: <4edb1433-4d1e-5719-ec9c-fd232b7cf71f@linux.microsoft.com> In-Reply-To: <20210415191437.20212-1-nramas@linux.microsoft.com> List-Id: --===============5468598607219636404== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On 4/15/21 12:14 PM, Lakshmi Ramasubramanian wrote: Sorry - missed copying device-tree and powerpc mailing lists. > There are a few "goto out;" statements before the local variable "fdt" > is initialized through the call to of_kexec_alloc_and_setup_fdt() in > elf64_load(). This will result in an uninitialized "fdt" being passed > to kvfree() in this function if there is an error before the call to > of_kexec_alloc_and_setup_fdt(). > = > Initialize the local variable "fdt" to NULL. > = > Signed-off-by: Lakshmi Ramasubramanian > Reported-by: kernel test robot > Reported-by: Dan Carpenter > --- > arch/powerpc/kexec/elf_64.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > = > diff --git a/arch/powerpc/kexec/elf_64.c b/arch/powerpc/kexec/elf_64.c > index 5a569bb51349..0051440c1f77 100644 > --- a/arch/powerpc/kexec/elf_64.c > +++ b/arch/powerpc/kexec/elf_64.c > @@ -32,7 +32,7 @@ static void *elf64_load(struct kimage *image, char *ker= nel_buf, > int ret; > unsigned long kernel_load_addr; > unsigned long initrd_load_addr =3D 0, fdt_load_addr; > - void *fdt; > + void *fdt =3D NULL; > const void *slave_code; > struct elfhdr ehdr; > char *modified_cmdline =3D NULL; > = thanks, -lakshmi --===============5468598607219636404==--