net: hns3: fix race condition in debugfs
authorYufeng Mo <moyufeng@huawei.com>
Fri, 10 Dec 2021 13:09:34 +0000 (21:09 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Dec 2021 08:32:40 +0000 (09:32 +0100)
commit769f38809709e8aea0b6959589faf9191f984ec6
treedacb227561600219d12d003dfe01eb1b3e579bfb
parent4f4a353f6fe033807cd026a5de81c67469ff19b0
net: hns3: fix race condition in debugfs

[ Upstream commit 6dde452bceca3f2ed2b33bc46a16ff5682a03a2e ]

When multiple threads concurrently access the debugfs content, data
and pointer exceptions may occur. Therefore, mutex lock protection is
added for debugfs.

Fixes: 5e69ea7ee2a6 ("net: hns3: refactor the debugfs process")
Signed-off-by: Yufeng Mo <moyufeng@huawei.com>
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/hisilicon/hns3/hnae3.h
drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c