ipw2x00: remove the right /proc/net entry

Commit 27ae60f8f7aa ("ipw2x00: replace "ieee80211" with "libipw" where
appropriate") changed DRV_NAME to be "libipw", but didn't properly fix
up the places where it was used to specify the name for the /proc/net/
directory.

For backwards compatibility reasons, that directory name remained
"ieee80211", but due to the DRV_NAME change, the error case printouts
and the cleanup functions now used "libipw" instead. Which made it all
fail badly.

For example, on module unload as reported by Randy:

WARNING: at fs/proc/generic.c:816 remove_proc_entry+0x156/0x35e()
name 'libipw'

because it's trying to unregister a /proc directory that obviously
doesn't even exist.

Clean it all up to use DRV_PROCNAME for the actual /proc directory name.

Reported-and-tested-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Pavel Roskin <proski@gnu.org>
Cc: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

+5 -4
+5 -4
drivers/net/wireless/ipw2x00/libipw_module.c
··· 54 55 #define DRV_DESCRIPTION "802.11 data/management/control stack" 56 #define DRV_NAME "libipw" 57 #define DRV_VERSION LIBIPW_VERSION 58 #define DRV_COPYRIGHT "Copyright (C) 2004-2005 Intel Corporation <jketreno@linux.intel.com>" 59 ··· 294 struct proc_dir_entry *e; 295 296 libipw_debug_level = debug; 297 - libipw_proc = proc_mkdir("ieee80211", init_net.proc_net); 298 if (libipw_proc == NULL) { 299 - LIBIPW_ERROR("Unable to create " DRV_NAME 300 " proc directory\n"); 301 return -EIO; 302 } 303 e = proc_create("debug_level", S_IRUGO | S_IWUSR, libipw_proc, 304 &debug_level_proc_fops); 305 if (!e) { 306 - remove_proc_entry(DRV_NAME, init_net.proc_net); 307 libipw_proc = NULL; 308 return -EIO; 309 } ··· 320 #ifdef CONFIG_LIBIPW_DEBUG 321 if (libipw_proc) { 322 remove_proc_entry("debug_level", libipw_proc); 323 - remove_proc_entry(DRV_NAME, init_net.proc_net); 324 libipw_proc = NULL; 325 } 326 #endif /* CONFIG_LIBIPW_DEBUG */
··· 54 55 #define DRV_DESCRIPTION "802.11 data/management/control stack" 56 #define DRV_NAME "libipw" 57 + #define DRV_PROCNAME "ieee80211" 58 #define DRV_VERSION LIBIPW_VERSION 59 #define DRV_COPYRIGHT "Copyright (C) 2004-2005 Intel Corporation <jketreno@linux.intel.com>" 60 ··· 293 struct proc_dir_entry *e; 294 295 libipw_debug_level = debug; 296 + libipw_proc = proc_mkdir(DRV_PROCNAME, init_net.proc_net); 297 if (libipw_proc == NULL) { 298 + LIBIPW_ERROR("Unable to create " DRV_PROCNAME 299 " proc directory\n"); 300 return -EIO; 301 } 302 e = proc_create("debug_level", S_IRUGO | S_IWUSR, libipw_proc, 303 &debug_level_proc_fops); 304 if (!e) { 305 + remove_proc_entry(DRV_PROCNAME, init_net.proc_net); 306 libipw_proc = NULL; 307 return -EIO; 308 } ··· 319 #ifdef CONFIG_LIBIPW_DEBUG 320 if (libipw_proc) { 321 remove_proc_entry("debug_level", libipw_proc); 322 + remove_proc_entry(DRV_PROCNAME, init_net.proc_net); 323 libipw_proc = NULL; 324 } 325 #endif /* CONFIG_LIBIPW_DEBUG */