From: Zhu Yi Date: Thu, 9 Jul 2009 09:24:15 +0000 (+0800) Subject: iwmc3200wifi: fix NULL pointer dereference in iwm_if_free X-Git-Tag: MMI-PSA29.97-13-9~27020^2~132^2~20 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=513a2396d8e8327aff1ce50bea3fb4f16ff3455b;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git iwmc3200wifi: fix NULL pointer dereference in iwm_if_free 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 Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/iwmc3200wifi/netdev.c b/drivers/net/wireless/iwmc3200wifi/netdev.c index aaa20c6885c8..aea5ccf24ccf 100644 --- a/drivers/net/wireless/iwmc3200wifi/netdev.c +++ b/drivers/net/wireless/iwmc3200wifi/netdev.c @@ -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)