]> git.proxmox.com Git - mirror_ubuntu-focal-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)
committerPaolo Pisati <paolo.pisati@canonical.com>
Mon, 24 Feb 2020 15:19:28 +0000 (16:19 +0100)
commit246d0e7361331d8fed5ff9597108311853f0d138
tree5af81b48aa42c7067c1263974727fbc24b26faf2
parent87a75805d54fd2289b8b96636f0e379830aff33b
MIPS: Loongson: Fix potential NULL dereference in loongson3_platform_init()

BugLink: https://bugs.launchpad.net/bugs/1864488
[ Upstream commit 72d052e28d1d2363f9107be63ef3a3afdea6143c ]

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

Fixes: 3adeb2566b9b ("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
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
arch/mips/loongson64/loongson-3/platform.c