Commit ebf9ea04 authored by 蒋家盛's avatar 蒋家盛 Committed by Zheng Zengkai
Browse files

qlcnic: potential dereference null pointer of rx_queue->page_ring

stable inclusion
from stable-v5.10.89
commit 56b0bbba782b2dfec7d4c4afcf0c854e702c5cd8
bugzilla: 186140 https://gitee.com/openeuler/kernel/issues/I4S8HA

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



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

[ Upstream commit 60ec7fcf ]

The return value of kcalloc() needs to be checked.
To avoid dereference of null pointer in case of the failure of alloc.
Therefore, it might be better to change the return type of
qlcnic_sriov_alloc_vlans() and return -ENOMEM when alloc fails and
return 0 the others.
Also, qlcnic_sriov_set_guest_vlan_mode() and __qlcnic_pci_sriov_enable()
should deal with the return value of qlcnic_sriov_alloc_vlans().

Fixes: 154d0c81 ("qlcnic: VLAN enhancement for 84XX adapters")
Signed-off-by: default avatarJiasheng Jiang <jiasheng@iscas.ac.cn>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 5cde5fda
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment