Commit 584645d8 authored by Xiaoke Wang's avatar Xiaoke Wang Committed by Zheng Zengkai
Browse files

MIPS: lantiq: check the return value of kzalloc()

stable inclusion
from stable-v5.10.118
commit 9b7f3211064dcb7c59f0fc2f10b26652267d9800
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5L686

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=9b7f3211064dcb7c59f0fc2f10b26652267d9800



--------------------------------

[ Upstream commit 34123208 ]

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: default avatarXiaoke Wang <xkernel.wang@foxmail.com>
Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: default avatarXie XiuQi <xiexiuqi@huawei.com>
parent 2509ac16
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment