mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-03-21 06:24:12 +00:00
net-sysfs: Use rtnl_trylock in wireless sysfs methods.
The wireless sysfs methods like the rest of the networking sysfs methods are removed with the rtnl_lock held and block until the existing methods stop executing. So use rtnl_trylock and restart_syscall so that the code continues to work. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
88af182e38
commit
b8afe64161
1 changed files with 2 additions and 1 deletions
|
@ -410,7 +410,8 @@ static ssize_t wireless_show(struct device *d, char *buf,
|
||||||
const struct iw_statistics *iw;
|
const struct iw_statistics *iw;
|
||||||
ssize_t ret = -EINVAL;
|
ssize_t ret = -EINVAL;
|
||||||
|
|
||||||
rtnl_lock();
|
if (!rtnl_trylock())
|
||||||
|
return restart_syscall();
|
||||||
if (dev_isalive(dev)) {
|
if (dev_isalive(dev)) {
|
||||||
iw = get_wireless_stats(dev);
|
iw = get_wireless_stats(dev);
|
||||||
if (iw)
|
if (iw)
|
||||||
|
|
Loading…
Add table
Reference in a new issue