net: hns3: fix the concurrency between functions reading debugfs
authorYufeng Mo <moyufeng@huawei.com>
Wed, 30 Mar 2022 13:45:05 +0000 (21:45 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:24:10 +0000 (14:24 +0200)
commita0817ad3f283f40c41d0ed4ffffa99d09adf2d77
treea1d979047ec1109d04498d10bd412ab4bacdd739
parent5c3c9bce1c99bf58efdf1c7af870240777ca64b5
net: hns3: fix the concurrency between functions reading debugfs

commit 9c9a04212fa380d2e7d1412bb281309955c0a781 upstream.

Currently, the debugfs mechanism is that all functions share a
global variable to save the pointer for obtaining data. When
different functions concurrently access the same file node,
repeated release exceptions occur. Therefore, the granularity
of the pointer for storing the obtained data is adjusted to be
private for each function.

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: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/hisilicon/hns3/hnae3.h
drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.h