From: Lakshmi Ramasubramanian <nramas@linux.microsoft.com>
To: robh@kernel.org, dan.carpenter@oracle.com, mpe@ellerman.id.au
Cc: devicetree@vger.kernel.org, kbuild-all@lists.01.org,
lkp@intel.com, nramas@linux.microsoft.com,
linuxppc-dev@lists.ozlabs.org, bauerman@linux.ibm.com,
dja@axtens.net
Subject: [PATCH 2/2] powerpc: If kexec_build_elf_info() fails return immediately from elf64_load()
Date: Tue, 20 Apr 2021 12:03:55 -0700 [thread overview]
Message-ID: <20210420190355.10059-2-nramas@linux.microsoft.com> (raw)
In-Reply-To: <20210420190355.10059-1-nramas@linux.microsoft.com>
Uninitialized local variable "elf_info" would be passed to
kexec_free_elf_info() if kexec_build_elf_info() returns an error
in elf64_load().
If kexec_build_elf_info() returns an error, return the error
immediately.
Signed-off-by: Lakshmi Ramasubramanian <nramas@linux.microsoft.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
---
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 02662e72c53d..eeb258002d1e 100644
--- a/arch/powerpc/kexec/elf_64.c
+++ b/arch/powerpc/kexec/elf_64.c
@@ -45,7 +45,7 @@ static void *elf64_load(struct kimage *image, char *kernel_buf,
ret = kexec_build_elf_info(kernel_buf, kernel_len, &ehdr, &elf_info);
if (ret)
- goto out;
+ return ERR_PTR(ret);
if (image->type == KEXEC_TYPE_CRASH) {
/* min & max buffer values for kdump case */
--
2.31.0
WARNING: multiple messages have this Message-ID (diff)
From: Lakshmi Ramasubramanian <nramas@linux.microsoft.com>
To: robh@kernel.org, dan.carpenter@oracle.com, mpe@ellerman.id.au
Cc: bauerman@linux.ibm.com, dja@axtens.net,
christophe.leroy@csgroup.eu, nramas@linux.microsoft.com,
lkp@intel.com, kbuild-all@lists.01.org,
devicetree@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
Subject: [PATCH 2/2] powerpc: If kexec_build_elf_info() fails return immediately from elf64_load()
Date: Tue, 20 Apr 2021 12:03:55 -0700 [thread overview]
Message-ID: <20210420190355.10059-2-nramas@linux.microsoft.com> (raw)
In-Reply-To: <20210420190355.10059-1-nramas@linux.microsoft.com>
Uninitialized local variable "elf_info" would be passed to
kexec_free_elf_info() if kexec_build_elf_info() returns an error
in elf64_load().
If kexec_build_elf_info() returns an error, return the error
immediately.
Signed-off-by: Lakshmi Ramasubramanian <nramas@linux.microsoft.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
---
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 02662e72c53d..eeb258002d1e 100644
--- a/arch/powerpc/kexec/elf_64.c
+++ b/arch/powerpc/kexec/elf_64.c
@@ -45,7 +45,7 @@ static void *elf64_load(struct kimage *image, char *kernel_buf,
ret = kexec_build_elf_info(kernel_buf, kernel_len, &ehdr, &elf_info);
if (ret)
- goto out;
+ return ERR_PTR(ret);
if (image->type == KEXEC_TYPE_CRASH) {
/* min & max buffer values for kdump case */
--
2.31.0
WARNING: multiple messages have this Message-ID (diff)
From: Lakshmi Ramasubramanian <nramas@linux.microsoft.com>
To: kbuild-all@lists.01.org
Subject: [PATCH 2/2] powerpc: If kexec_build_elf_info() fails return immediately from elf64_load()
Date: Tue, 20 Apr 2021 12:03:55 -0700 [thread overview]
Message-ID: <20210420190355.10059-2-nramas@linux.microsoft.com> (raw)
In-Reply-To: <20210420190355.10059-1-nramas@linux.microsoft.com>
[-- Attachment #1: Type: text/plain, Size: 940 bytes --]
Uninitialized local variable "elf_info" would be passed to
kexec_free_elf_info() if kexec_build_elf_info() returns an error
in elf64_load().
If kexec_build_elf_info() returns an error, return the error
immediately.
Signed-off-by: Lakshmi Ramasubramanian <nramas@linux.microsoft.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
---
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 02662e72c53d..eeb258002d1e 100644
--- a/arch/powerpc/kexec/elf_64.c
+++ b/arch/powerpc/kexec/elf_64.c
@@ -45,7 +45,7 @@ static void *elf64_load(struct kimage *image, char *kernel_buf,
ret = kexec_build_elf_info(kernel_buf, kernel_len, &ehdr, &elf_info);
if (ret)
- goto out;
+ return ERR_PTR(ret);
if (image->type == KEXEC_TYPE_CRASH) {
/* min & max buffer values for kdump case */
--
2.31.0
next prev parent reply other threads:[~2021-04-20 19:04 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-20 19:03 [PATCH 1/2] powerpc: Free fdt on error in elf64_load() Lakshmi Ramasubramanian
2021-04-20 19:03 ` Lakshmi Ramasubramanian
2021-04-20 19:03 ` Lakshmi Ramasubramanian
2021-04-20 19:03 ` Lakshmi Ramasubramanian [this message]
2021-04-20 19:03 ` [PATCH 2/2] powerpc: If kexec_build_elf_info() fails return immediately from elf64_load() Lakshmi Ramasubramanian
2021-04-20 19:03 ` Lakshmi Ramasubramanian
2021-04-21 7:21 ` Michael Ellerman
2021-04-21 7:21 ` Michael Ellerman
2021-04-21 7:21 ` Michael Ellerman
2021-04-21 5:35 ` [PATCH 1/2] powerpc: Free fdt on error in elf64_load() Santosh Sivaraj
2021-04-21 5:35 ` Santosh Sivaraj
2021-04-21 13:58 ` Lakshmi Ramasubramanian
2021-04-21 13:58 ` Lakshmi Ramasubramanian
2021-04-21 14:02 ` Santosh Sivaraj
2021-04-21 14:02 ` Santosh Sivaraj
2021-04-21 7:18 ` Michael Ellerman
2021-04-21 7:18 ` Michael Ellerman
2021-04-21 7:18 ` Michael Ellerman
2021-04-21 14:01 ` Lakshmi Ramasubramanian
2021-04-21 14:01 ` Lakshmi Ramasubramanian
2021-04-21 14:01 ` Lakshmi Ramasubramanian
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210420190355.10059-2-nramas@linux.microsoft.com \
--to=nramas@linux.microsoft.com \
--cc=bauerman@linux.ibm.com \
--cc=dan.carpenter@oracle.com \
--cc=devicetree@vger.kernel.org \
--cc=dja@axtens.net \
--cc=kbuild-all@lists.01.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=lkp@intel.com \
--cc=mpe@ellerman.id.au \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.