MIPS: Loongson64: Add WARN_ON on kexec related kmalloc failed
authorLiao Chang <liaochang1@huawei.com>
Thu, 3 Nov 2022 01:18:15 +0000 (09:18 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 26 Nov 2022 08:24:38 +0000 (09:24 +0100)
commit12f178cf05f3c59cb56970ba3222cd60aaf8afa1
tree9158a19b54ffcf975f73d61b7f542db2cc988a47
parenta4d6e024bea2526e91c1d4c70aa40a79cedb1b8c
MIPS: Loongson64: Add WARN_ON on kexec related kmalloc failed

[ Upstream commit fa706927f4722a2df723b2a28d139b1904a3e7fa ]

Add WARN_ON on kexec related kmalloc failed, avoid to pass NULL pointer
to following memcpy and loongson_kexec_prepare.

Fixes: 6ce48897ce47 ("MIPS: Loongson64: Add kexec/kdump support")
Signed-off-by: Liao Chang <liaochang1@huawei.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/mips/loongson64/reset.c