iwmc3200wifi: fix NULL pointer dereference in iwm_if_free
authorZhu Yi <yi.zhu@intel.com>
Thu, 9 Jul 2009 09:24:15 +0000 (17:24 +0800)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 21 Jul 2009 16:07:31 +0000 (12:07 -0400)
The driver private data is now based on wiphy. So we should not
touch the private data after wiphy_free() is called. The patch
fixes the potential NULL pointer dereference by making the
iwm_wdev_free() the last one on the interface removal path.

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwmc3200wifi/netdev.c

index aaa20c6885c8774c4e2af9e30164034456fb16f4..aea5ccf24ccf573533a48a22345aa5c464030010 100644 (file)
@@ -151,8 +151,8 @@ void iwm_if_free(struct iwm_priv *iwm)
                return;
 
        free_netdev(iwm_to_ndev(iwm));
-       iwm_wdev_free(iwm);
        iwm_priv_deinit(iwm);
+       iwm_wdev_free(iwm);
 }
 
 int iwm_if_add(struct iwm_priv *iwm)