1 Subject: cfg80211: fix debugfs error handling
3 If something goes wrong creating the debugfs dir or when
4 debugfs is not compiled in, the current code might lead to
5 trouble; make it more robust.
7 Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
9 net/wireless/core.c | 5 ++++-
10 1 file changed, 4 insertions(+), 1 deletion(-)
12 --- everything.orig/net/wireless/core.c 2008-10-08 10:13:49.000000000 +0200
13 +++ everything/net/wireless/core.c 2008-10-08 10:19:10.000000000 +0200
14 @@ -185,7 +185,8 @@ int cfg80211_dev_rename(struct cfg80211_
18 - if (!debugfs_rename(rdev->wiphy.debugfsdir->d_parent,
19 + if (rdev->wiphy.debugfsdir &&
20 + !debugfs_rename(rdev->wiphy.debugfsdir->d_parent,
21 rdev->wiphy.debugfsdir,
22 rdev->wiphy.debugfsdir->d_parent,
24 @@ -318,6 +319,8 @@ int wiphy_register(struct wiphy *wiphy)
25 drv->wiphy.debugfsdir =
26 debugfs_create_dir(wiphy_name(&drv->wiphy),
27 ieee80211_debugfs_dir);
28 + if (IS_ERR(drv->wiphy.debugfsdir))
29 + drv->wiphy.debugfsdir = NULL;