From: Eric W. Biederman Date: Fri, 19 Feb 2010 13:23:47 +0000 (+0000) Subject: net-sysfs: Use rtnl_trylock in wireless sysfs methods. X-Git-Tag: firefly_0821_release~10186^2~2138 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9c42239c50d46364aecf2d5b6a927464a52e2723;p=firefly-linux-kernel-4.4.55.git net-sysfs: Use rtnl_trylock in wireless sysfs methods. [ Upstream commit b8afe6416101549e877f8470f2a160df69676166 ] 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 Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index 427ded841224..d5617d45deef 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c @@ -366,7 +366,8 @@ static ssize_t wireless_show(struct device *d, char *buf, const struct iw_statistics *iw; ssize_t ret = -EINVAL; - rtnl_lock(); + if (!rtnl_trylock()) + return restart_syscall(); if (dev_isalive(dev)) { iw = get_wireless_stats(dev); if (iw)