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 07:14:32 +0000 (09:14 +0200)
commit83abb076f473b6266ededbf420e92b8b81d2f110
treed83ce9582f74f3f4888446cb8d8e5df8d954cf8f
parente7947c031ffe9459d7025d8065939e30215c3219
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