diff options
| author | Stanislav Fomichev <[email protected]> | 2025-03-12 19:05:12 +0000 |
|---|---|---|
| committer | Paolo Abeni <[email protected]> | 2025-03-19 17:52:00 +0000 |
| commit | 8033d2aef51722fe74068b52553625ed91ea256c (patch) | |
| tree | 6910b7f09c5c94632c251b1564cb17f9330682a9 /net/core/net-sysfs.c | |
| parent | tc-tests: Update tc police action tests for tc buffer size rounding fixes. (diff) | |
| download | kernel-8033d2aef51722fe74068b52553625ed91ea256c.tar.gz kernel-8033d2aef51722fe74068b52553625ed91ea256c.zip | |
Revert "net: replace dev_addr_sem with netdev instance lock"
This reverts commit df43d8bf10316a7c3b1e47e3cc0057a54df4a5b8.
Cc: Kohei Enju <[email protected]>
Reviewed-by: Kuniyuki Iwashima <[email protected]>
Fixes: df43d8bf1031 ("net: replace dev_addr_sem with netdev instance lock")
Signed-off-by: Stanislav Fomichev <[email protected]>
Link: https://patch.msgid.link/[email protected]
Tested-by: Lei Yang <[email protected]>
Signed-off-by: Paolo Abeni <[email protected]>
Diffstat (limited to 'net/core/net-sysfs.c')
| -rw-r--r-- | net/core/net-sysfs.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index 529a0f721268..abaa1c919b98 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c @@ -263,11 +263,14 @@ static ssize_t address_show(struct device *dev, struct device_attribute *attr, struct net_device *ndev = to_net_dev(dev); ssize_t ret = -EINVAL; - netdev_lock(ndev); + down_read(&dev_addr_sem); + + rcu_read_lock(); if (dev_isalive(ndev)) ret = sysfs_format_mac(buf, ndev->dev_addr, ndev->addr_len); - netdev_unlock(ndev); + rcu_read_unlock(); + up_read(&dev_addr_sem); return ret; } static DEVICE_ATTR_RO(address); |
