efi/fdt: fix panic when no valid fdt found
authorChangbin Du <changbin.du@gmail.com>
Wed, 24 Mar 2021 14:54:35 +0000 (22:54 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Jun 2021 11:39:13 +0000 (13:39 +0200)
commit5148066edbdc89c6fe5bc419c31a5c22e5f83bdb
tree64cf17bfbc41b09853c7f5ec7e3768bdcd63e32d
parent39a909a9720dd5a7b423f97c3737541d0ef76c06
efi/fdt: fix panic when no valid fdt found

[ Upstream commit 668a84c1bfb2b3fd5a10847825a854d63fac7baa ]

setup_arch() would invoke efi_init()->efi_get_fdt_params(). If no
valid fdt found then initial_boot_params will be null. So we
should stop further fdt processing here. I encountered this
issue on risc-v.

Signed-off-by: Changbin Du <changbin.du@gmail.com>
Fixes: b91540d52a08b ("RISC-V: Add EFI runtime services")
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/firmware/efi/fdtparams.c