iwlwifi: change the order of freeing memory
authorWey-Yi Guy <wey-yi.w.guy@intel.com>
Fri, 9 Oct 2009 20:20:17 +0000 (13:20 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 12 Oct 2009 19:55:52 +0000 (15:55 -0400)
Need to free the dynamic allocated memory before ieee80211_free_hw();
once call ieee80211_free_hw(), should not reference to "priv" data
structure.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl-agn.c
drivers/net/wireless/iwlwifi/iwl3945-base.c

index cdc07c477457b557a82288dd676eaeca6a4eee71..9b5ea8ba7216afe1d205b7d2fb1e8a2d5e8e0c37 100644 (file)
@@ -3105,8 +3105,8 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
  out_pci_disable_device:
        pci_disable_device(pdev);
  out_ieee80211_free_hw:
-       ieee80211_free_hw(priv->hw);
        iwl_free_traffic_mem(priv);
+       ieee80211_free_hw(priv->hw);
  out:
        return err;
 }
index c390dbd877e4a59000571e2064e7eba4611bddbd..837a193221cf3f1969064455e6b3267f4da3dd2d 100644 (file)
@@ -4096,8 +4096,8 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
        pci_set_drvdata(pdev, NULL);
        pci_disable_device(pdev);
  out_ieee80211_free_hw:
-       ieee80211_free_hw(priv->hw);
        iwl_free_traffic_mem(priv);
+       ieee80211_free_hw(priv->hw);
  out:
        return err;
 }