s390/kexec: fix return code handling
authorHeiko Carstens <hca@linux.ibm.com>
Tue, 16 Nov 2021 10:06:38 +0000 (11:06 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Nov 2021 08:48:41 +0000 (09:48 +0100)
commit4220cc6e113caa126ddca8eeb796c213cb492e0e
treed673710cf5850521497489b1de42f98bb2852354
parent737143025c18b077271bd7bc3cfdabbc6adf1944
s390/kexec: fix return code handling

[ Upstream commit 20c76e242e7025bd355619ba67beb243ba1a1e95 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/s390/kernel/ipl.c
arch/s390/kernel/machine_kexec_file.c