]> git.hungrycats.org Git - linux/commitdiff
[PATCH] fix airo oops-on-removal
authorAndrew Morton <akpm@osdl.org>
Wed, 14 Jul 2004 10:42:35 +0000 (06:42 -0400)
committerJeff Garzik <jgarzik@pobox.com>
Wed, 14 Jul 2004 10:42:35 +0000 (06:42 -0400)
From: Bill Nottingham <notting@redhat.com>

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.)

Signed-off-by: Andrew Morton <akpm@osdl.org>
drivers/net/wireless/airo.c

index 302654d7fb711c93d9d68cbb1eb3c2d52d89a326..e875cf991e0ad21faf0591313a1a6a7afa2e2fed 100644 (file)
@@ -1210,6 +1210,7 @@ struct airo_info {
        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 @@ static int setup_proc_entry( struct net_device *dev,
                             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;
@@ -4470,7 +4472,7 @@ static int takedown_proc_entry( struct net_device *dev,
        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;
 }