summaryrefslogtreecommitdiffstats
path: root/net/mac80211/debugfs_netdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/debugfs_netdev.c')
-rw-r--r--net/mac80211/debugfs_netdev.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c
index 8165df578c92..5c7bbe07b79c 100644
--- a/net/mac80211/debugfs_netdev.c
+++ b/net/mac80211/debugfs_netdev.c
@@ -537,6 +537,7 @@ static int netdev_notify(struct notifier_block *nb,
{
struct net_device *dev = ndev;
struct dentry *dir;
+ struct ieee80211_local *local;
struct ieee80211_sub_if_data *sdata;
char buf[10+IFNAMSIZ];
@@ -549,10 +550,19 @@ static int netdev_notify(struct notifier_block *nb,
if (dev->ieee80211_ptr->wiphy->privid != mac80211_wiphy_privid)
return 0;
- sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+ /*
+ * Do not use IEEE80211_DEV_TO_SUB_IF because that
+ * BUG_ONs for the master netdev which we need to
+ * handle here.
+ */
+ sdata = netdev_priv(dev);
- sprintf(buf, "netdev:%s", dev->name);
dir = sdata->debugfsdir;
+
+ if (!dir)
+ return 0;
+
+ sprintf(buf, "netdev:%s", dev->name);
if (!debugfs_rename(dir->d_parent, dir, dir->d_parent, buf))
printk(KERN_ERR "mac80211: debugfs: failed to rename debugfs "
"dir to %s\n", buf);