Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c74e90a9 authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville
Browse files

mac80211: fix debugfs netdev rename



If, for some reason, a netdev has no debugfs dir, we shouldn't
try to rename that dir.

Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Cc: Robin Holt <holt@sgi.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent d5d7c584
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -545,8 +545,12 @@ static int netdev_notify(struct notifier_block *nb,

	sdata = IEEE80211_DEV_TO_SUB_IF(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);