mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] fix airo oops-on-removal
@ 2004-07-08 21:31 Bill Nottingham
  2004-07-08 21:34 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Bill Nottingham @ 2004-07-08 21:31 UTC (permalink / raw)
  To: linux-kernel; +Cc: breed, fabrice

[-- Attachment #1: Type: text/plain, Size: 527 bytes --]

airo creates /proc/driver/aironet/<device name> on device activation.
However, the device can be renamed - then on teardown
it tries to remove the wrong directory. The removal of 
/proc/driver/aironet then runs afoul of the BUG_ON() in remove_proc_entry.

This fixes it by keeping a copy of the name of the directory
it created.

(It doesn't actually solve the problem of the stats directory
still being /proc/driver/aironet/eth0 when you rename the device
to, say, 'joe'. But that patch would be a little less trivial.)

Bill

[-- Attachment #2: airo.patch --]
[-- Type: text/plain, Size: 1047 bytes --]

--- linux/drivers/net/wireless/airo.c.old	2004-07-08 17:19:37.856055132 -0400
+++ linux/drivers/net/wireless/airo.c	2004-07-08 17:28:26.720339699 -0400
@@ -1210,6 +1210,7 @@
 	APListRid		*APList;
 #define	PCI_SHARED_LEN		2*MPI_MAX_FIDS*PKTSIZE+RIDSIZE
 	u32			pci_state[16];
+	char			proc_name[IFNAMSIZ];
 };
 
 static inline int bap_read(struct airo_info *ai, u16 *pu16Dst, int bytelen,
@@ -4369,7 +4370,8 @@
 			     struct airo_info *apriv ) {
 	struct proc_dir_entry *entry;
 	/* First setup the device directory */
-	apriv->proc_entry = create_proc_entry(dev->name,
+	strcpy(apriv->proc_name,dev->name);
+	apriv->proc_entry = create_proc_entry(apriv->proc_name,
 					      S_IFDIR|airo_perm,
 					      airo_entry);
         apriv->proc_entry->uid = proc_uid;
@@ -4472,7 +4474,7 @@
 	remove_proc_entry("APList",apriv->proc_entry);
 	remove_proc_entry("BSSList",apriv->proc_entry);
 	remove_proc_entry("WepKey",apriv->proc_entry);
-	remove_proc_entry(dev->name,airo_entry);
+	remove_proc_entry(apriv->proc_name,airo_entry);
 	return 0;
 }
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-07-08 21:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-08 21:31 [PATCH] fix airo oops-on-removal Bill Nottingham
2004-07-08 21:34 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®