linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2.6.27] mac80211: fix two issues in debugfs
@ 2008-10-10 15:52 Johannes Berg
  2008-10-10 16:01 ` [stable] " Greg KH
  2008-10-15 21:38 ` patch mac80211-fix-two-issues-in-debugfs.patch added to 2.6.27-stable tree gregkh
  0 siblings, 2 replies; 5+ messages in thread
From: Johannes Berg @ 2008-10-10 15:52 UTC (permalink / raw)
  To: stable; +Cc: John Linville, linux-wireless

This fixes RHBZ 466264, whenever the master interface is
renamed this code would BUG_ON. Also fixes a separately
reported bug with the debugfs dir being NULL.

This patch is not applicable to the next kernel version
because both these issues have been fixed, the first one
by not having the master interface have a ieee80211_ptr
at all, and the second one by also leaving the function
early.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: John Linville <linville@tuxdriver.com>
---
 net/mac80211/debugfs_netdev.c |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

--- net-tx-2.6.orig/net/mac80211/debugfs_netdev.c	2008-10-10 17:46:50.000000000 +0200
+++ net-tx-2.6/net/mac80211/debugfs_netdev.c	2008-10-10 17:48:41.000000000 +0200
@@ -537,6 +537,7 @@ static int netdev_notify(struct notifier
 {
 	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
 	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);



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-10-15 21:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-10 15:52 [PATCH v2.6.27] mac80211: fix two issues in debugfs Johannes Berg
2008-10-10 16:01 ` [stable] " Greg KH
2008-10-10 16:30   ` Johannes Berg
2008-10-10 16:50     ` Greg KH
2008-10-15 21:38 ` patch mac80211-fix-two-issues-in-debugfs.patch added to 2.6.27-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).