MIPS: lantiq: check the return value of kzalloc()
authorXiaoke Wang <xkernel.wang@foxmail.com>
Fri, 25 Mar 2022 11:49:41 +0000 (19:49 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 May 2022 06:39:48 +0000 (08:39 +0200)
commit2c337e8be8af822b376996cef50e1d4ebc40b923
tree6b5f6dd12b8385a6878d2feb4d17fb1f0d7288dc
parent3e6fa9e4a7a89d67e01424317f7a2e9551025022
MIPS: lantiq: check the return value of kzalloc()

[ Upstream commit 34123208bbcc8c884a0489f543a23fe9eebb5514 ]

kzalloc() is a memory allocation function which can return NULL when
some internal memory errors happen. So it is better to check the
return value of it to prevent potential wrong memory access or
memory leak.

Signed-off-by: Xiaoke Wang <xkernel.wang@foxmail.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/mips/lantiq/falcon/sysctrl.c
arch/mips/lantiq/xway/gptu.c
arch/mips/lantiq/xway/sysctrl.c