Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH] cfg80211: fix debugfs error handling
@ 2008-10-08  8:23 Johannes Berg
  0 siblings, 0 replies; only message in thread
From: Johannes Berg @ 2008-10-08  8:23 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

If something goes wrong creating the debugfs dir or when
debugfs is not compiled in, the current code might lead to
trouble; make it more robust.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 net/wireless/core.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- everything.orig/net/wireless/core.c	2008-10-08 10:13:49.000000000 +0200
+++ everything/net/wireless/core.c	2008-10-08 10:19:10.000000000 +0200
@@ -185,7 +185,8 @@ int cfg80211_dev_rename(struct cfg80211_
 	if (result)
 		goto out_unlock;
 
-	if (!debugfs_rename(rdev->wiphy.debugfsdir->d_parent,
+	if (rdev->wiphy.debugfsdir &&
+	    !debugfs_rename(rdev->wiphy.debugfsdir->d_parent,
 			    rdev->wiphy.debugfsdir,
 			    rdev->wiphy.debugfsdir->d_parent,
 			    newname))
@@ -318,6 +319,8 @@ int wiphy_register(struct wiphy *wiphy)
 	drv->wiphy.debugfsdir =
 		debugfs_create_dir(wiphy_name(&drv->wiphy),
 				   ieee80211_debugfs_dir);
+	if (IS_ERR(drv->wiphy.debugfsdir))
+		drv->wiphy.debugfsdir = NULL;
 
 	res = 0;
 out_unlock:



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-10-08  8:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-08  8:23 [PATCH] cfg80211: fix debugfs error handling Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox