Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 151f52f0 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

ipw2x00: remove the right /proc/net entry



Commit 27ae60f8 ("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: default avatarRandy Dunlap <randy.dunlap@oracle.com>
Cc: Pavel Roskin <proski@gnu.org>
Cc: John W. Linville <linville@tuxdriver.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent d4285bd6
Loading
Loading
Loading
Loading
+5 −4
Original line number Original line Diff line number Diff line
@@ -54,6 +54,7 @@


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


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


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