Content-Type: multipart/mixed; boundary="===============3857727396234866316==" MIME-Version: 1.0 From: Rob Herring To: kbuild-all@lists.01.org Subject: Re: [PATCH v2 1/2] powerpc: Free fdt on error in elf64_load() Date: Mon, 26 Apr 2021 16:25:20 -0500 Message-ID: <20210426212520.GA4112479@robh.at.kernel.org> In-Reply-To: <20210421163610.23775-1-nramas@linux.microsoft.com> List-Id: --===============3857727396234866316== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Wed, 21 Apr 2021 09:36:09 -0700, Lakshmi Ramasubramanian wrote: > 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(). > = > If there is any error after fdt is allocated, but before it is > saved in the arch specific kimage struct, free the fdt. > = > Reported-by: kernel test robot > Reported-by: Dan Carpenter > Signed-off-by: Michael Ellerman > Signed-off-by: Lakshmi Ramasubramanian > --- > arch/powerpc/kexec/elf_64.c | 16 ++++++---------- > 1 file changed, 6 insertions(+), 10 deletions(-) > = Applied, thanks! --===============3857727396234866316==--