Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH] iwmc3200wifi: fix NULL pointer dereference in iwm_if_free
@ 2009-07-09  9:16 Zhu Yi
  0 siblings, 0 replies; only message in thread
From: Zhu Yi @ 2009-07-09  9:16 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Zhu Yi

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>
---
 drivers/net/wireless/iwmc3200wifi/netdev.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/iwmc3200wifi/netdev.c b/drivers/net/wireless/iwmc3200wifi/netdev.c
index e94e969..bb71f8a 100644
--- a/drivers/net/wireless/iwmc3200wifi/netdev.c
+++ b/drivers/net/wireless/iwmc3200wifi/netdev.c
@@ -155,11 +155,11 @@ void iwm_if_free(struct iwm_priv *iwm)
 	if (!iwm_to_ndev(iwm))
 		return;
 
-	free_netdev(iwm_to_ndev(iwm));
-	iwm_wdev_free(iwm);
-	iwm_priv_deinit(iwm);
 	kfree(iwm->umac_profile);
 	iwm->umac_profile = NULL;
+	free_netdev(iwm_to_ndev(iwm));
+	iwm_priv_deinit(iwm);
+	iwm_wdev_free(iwm);
 }
 
 int iwm_if_add(struct iwm_priv *iwm)
-- 
1.6.0.4


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-07-09  9:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-09  9:16 [PATCH] iwmc3200wifi: fix NULL pointer dereference in iwm_if_free Zhu Yi

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