]> 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)
commit4b59b06c11cbe9e897946de17492d5c17292f8f7
tree4ff25b6864f76dc173d62327ef11ab24c5e9779f
parentcbe683b390f002d6dc1b164cc738816daf42d5ad
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: 022ef6aeb9cb ("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