net: hns3: add vlan list lock to protect vlan list
authorJian Shen <shenjian15@huawei.com>
Thu, 24 Mar 2022 12:54:49 +0000 (20:54 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:23:52 +0000 (14:23 +0200)
commit30f0ff7176efe8ac6c55f85bce26ed58bb608758
tree47fa5b071f6824134af5c9092494a2cdea9c1a80
parent02948e5782cea0585cad4831715468a09c13e106
net: hns3: add vlan list lock to protect vlan list

[ Upstream commit 1932a624ab88ff407d1a1d567fe581faa15dc725 ]

When adding port base VLAN, vf VLAN need to remove from HW and modify
the vlan state in vf VLAN list as false. If the periodicity task is
freeing the same node, it may cause "use after free" error.
This patch adds a vlan list lock to protect the vlan list.

Fixes: c6075b193462 ("net: hns3: Record VF vlan tables")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h