Skip to content

Commit

Permalink
libipw: fix proc entry removal
Browse files Browse the repository at this point in the history
This bug seems to be due to commit 27ae60f ("ipw2x00: replace
"ieee80211" with "libipw" where appropriate"), where Pavel did this:

-       libipw_proc = proc_mkdir(DRV_NAME, init_net.proc_net);
+       libipw_proc = proc_mkdir("ieee80211", init_net.proc_net);

but then the cleanup was kept as

        remove_proc_entry(DRV_NAME, init_net.proc_net);

in both places (both in the failure case and in the unload case). The
error string is also total crap, and says

     "Unable to create " DRV_NAME " proc directory\n");

Even though it doesn't actually create a proc directory named DRV_NAME at all.

So that patch looks like total and utter crap to me. The commit message says

  "Keep /proc/net/ieee80211 under the original name to avoid breaking user
    interface."

but the thing is, it really didn't fix anything but that one create
thing. It needs to fix all the other cases too.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Tested-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Linus Torvalds authored and John W. Linville committed Nov 8, 2010
1 parent 9f2a0fa commit 269e2d7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/net/wireless/ipw2x00/libipw_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@

#define DRV_DESCRIPTION "802.11 data/management/control stack"
#define DRV_NAME "libipw"
#define DRV_PROCNAME "ieee80211"
#define DRV_VERSION LIBIPW_VERSION
#define DRV_COPYRIGHT "Copyright (C) 2004-2005 Intel Corporation <jketreno@linux.intel.com>"

Expand Down Expand Up @@ -293,16 +294,16 @@ static int __init libipw_init(void)
struct proc_dir_entry *e;

libipw_debug_level = debug;
libipw_proc = proc_mkdir("ieee80211", init_net.proc_net);
libipw_proc = proc_mkdir(DRV_PROCNAME, init_net.proc_net);
if (libipw_proc == NULL) {
LIBIPW_ERROR("Unable to create " DRV_NAME
LIBIPW_ERROR("Unable to create " DRV_PROCNAME
" proc directory\n");
return -EIO;
}
e = proc_create("debug_level", S_IRUGO | S_IWUSR, libipw_proc,
&debug_level_proc_fops);
if (!e) {
remove_proc_entry(DRV_NAME, init_net.proc_net);
remove_proc_entry(DRV_PROCNAME, init_net.proc_net);
libipw_proc = NULL;
return -EIO;
}
Expand All @@ -319,7 +320,7 @@ static void __exit libipw_exit(void)
#ifdef CONFIG_LIBIPW_DEBUG
if (libipw_proc) {
remove_proc_entry("debug_level", libipw_proc);
remove_proc_entry(DRV_NAME, init_net.proc_net);
remove_proc_entry(DRV_PROCNAME, init_net.proc_net);
libipw_proc = NULL;
}
#endif /* CONFIG_LIBIPW_DEBUG */
Expand Down

0 comments on commit 269e2d7

Please sign in to comment.