Commit 5877d6fb authored by Xiaoke Wang's avatar Xiaoke Wang Committed by Zheng Zengkai
Browse files

net: ll_temac: check the return value of devm_kmalloc()

stable inclusion
from stable-v5.10.103
commit 550d98ab3007af7627694ba915f85681d4276ffa
bugzilla: https://gitee.com/openeuler/kernel/issues/I56NE7

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



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

commit b352c346 upstream.

devm_kmalloc() returns a pointer to allocated memory on success, NULL
on failure. While lp->indirect_lock is allocated by devm_kmalloc()
without proper check. It is better to check the value of it to
prevent potential wrong memory access.

Fixes: f14f5c11 ("net: ll_temac: Support indirect_mutex share within TEMAC IP")
Signed-off-by: default avatarXiaoke Wang <xkernel.wang@foxmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarYu Liao <liaoyu15@huawei.com>
Reviewed-by: default avatarWei Li <liwei391@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 55331b21
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment