diff options
author | Heiko Carstens <hca@linux.ibm.com> | 2021-11-16 13:06:38 +0300 |
---|---|---|
committer | Heiko Carstens <hca@linux.ibm.com> | 2021-11-18 19:25:35 +0300 |
commit | 20c76e242e7025bd355619ba67beb243ba1a1e95 (patch) | |
tree | 58c3e6c2e4cd4b129c446e7465fe38eef30c9df9 /arch/s390/kernel/ipl.c | |
parent | 3b90954419d4c05651de9cce6d7632bcf6977678 (diff) | |
download | linux-20c76e242e7025bd355619ba67beb243ba1a1e95.tar.xz |
s390/kexec: fix return code handling
kexec_file_add_ipl_report ignores that ipl_report_finish may fail and
can return an error pointer instead of a valid pointer.
Fix this and simplify by returning NULL in case of an error and let
the only caller handle this case.
Fixes: 99feaa717e55 ("s390/kexec_file: Create ipl report and pass to next kernel")
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'arch/s390/kernel/ipl.c')
-rw-r--r-- | arch/s390/kernel/ipl.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c index e2cc35775b99..5ad1dde23dc5 100644 --- a/arch/s390/kernel/ipl.c +++ b/arch/s390/kernel/ipl.c @@ -2156,7 +2156,7 @@ void *ipl_report_finish(struct ipl_report *report) buf = vzalloc(report->size); if (!buf) - return ERR_PTR(-ENOMEM); + goto out; ptr = buf; memcpy(ptr, report->ipib, report->ipib->hdr.len); @@ -2195,6 +2195,7 @@ void *ipl_report_finish(struct ipl_report *report) } BUG_ON(ptr > buf + report->size); +out: return buf; } |