]> git.baikalelectronics.ru Git - kernel.git/commit
MIPS: KASLR: Fix handling of NULL FDT
authorMatt Redfearn <matt.redfearn@imgtec.com>
Mon, 17 Oct 2016 16:21:46 +0000 (17:21 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Thu, 3 Nov 2016 23:30:49 +0000 (00:30 +0100)
commit4784ee16f78d152b537fca5b935a53def877330e
tree31a16594af6cbdf511dadea88664a213e44a52d8
parent1e93300d0d9c7244276aedbc28780499003c5659
MIPS: KASLR: Fix handling of NULL FDT

If platform code returns a NULL pointer to the FDT, initial_boot_params
will not get set to a valid pointer and attempting to find the /chosen
node in it will cause a NULL pointer dereference and the kernel to crash
immediately on startup - with no output to the console.

Fix this by checking that initial_boot_params is valid before using it.

Fixes: 9e6836a4767a ("MIPS: Kernel: Implement KASLR using CONFIG_RELOCATABLE")
Cc: stable@vger.kernel.org # 4.7+
Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/14414/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/kernel/relocate.c