]> git.baikalelectronics.ru Git - kernel.git/commit
MIPS: Loongson: Fix potential NULL dereference in loongson3_platform_init()
authorTiezhu Yang <yangtiezhu@loongson.cn>
Fri, 10 Jan 2020 01:30:42 +0000 (09:30 +0800)
committerPaul Burton <paulburton@kernel.org>
Fri, 10 Jan 2020 22:10:24 +0000 (14:10 -0800)
commit45a5e39a4cd7d496f37a72af75c45cf8b39e577c
tree4ff25b6864f76dc173d62327ef11ab24c5e9779f
parent1158191a6add5d6513174f10e6c0b4a119994957
MIPS: Loongson: Fix potential NULL dereference in loongson3_platform_init()

If kzalloc fails, it should return -ENOMEM, otherwise may trigger a NULL
pointer dereference.

Fixes: 9e40a24b8277 ("MIPS: Loongson: Improve LEFI firmware interface")
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Paul Burton <paulburton@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Huacai Chen <chenhc@lemote.com>
Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: linux-mips@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
arch/mips/loongson64/platform.c