Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

cfg80211: fix debugfs error handling

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>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Johannes Berg and committed by
John W. Linville
33c0360b c74e90a9

+4 -1
+4 -1
net/wireless/core.c
··· 184 184 if (result) 185 185 goto out_unlock; 186 186 187 - if (!debugfs_rename(rdev->wiphy.debugfsdir->d_parent, 187 + if (rdev->wiphy.debugfsdir && 188 + !debugfs_rename(rdev->wiphy.debugfsdir->d_parent, 188 189 rdev->wiphy.debugfsdir, 189 190 rdev->wiphy.debugfsdir->d_parent, 190 191 newname)) ··· 318 317 drv->wiphy.debugfsdir = 319 318 debugfs_create_dir(wiphy_name(&drv->wiphy), 320 319 ieee80211_debugfs_dir); 320 + if (IS_ERR(drv->wiphy.debugfsdir)) 321 + drv->wiphy.debugfsdir = NULL; 321 322 322 323 res = 0; 323 324 out_unlock: