Search Linux Wireless

[PATCH] wl12xx: free firmware after booting the chip

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



There is no need to save the fw in memory after it has been
uploaded to the chip.

Signed-off-by: Eliad Peller <eliad@xxxxxxxxxx>
---
 drivers/net/wireless/wl12xx/main.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 8a35491..e1944b1 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -691,7 +691,6 @@ static int wl1271_fetch_firmware(struct wl1271 *wl)
 		goto out;
 	}
 
-	vfree(wl->fw);
 	wl->fw_len = fw->size;
 	wl->fw = vmalloc(wl->fw_len);
 
@@ -891,7 +890,7 @@ int wl1271_plt_start(struct wl1271 *wl)
 		wl->state = WL1271_STATE_PLT;
 		wl1271_notice("firmware booted in PLT mode (%s)",
 			      wl->chip.fw_ver);
-		goto out;
+		goto out_free_fw;
 
 irq_disable:
 		wl1271_disable_interrupts(wl);
@@ -911,6 +910,9 @@ power_off:
 
 	wl1271_error("firmware boot in PLT mode failed despite %d retries",
 		     WL1271_BOOT_RETRIES);
+out_free_fw:
+	vfree(wl->fw);
+	wl->fw = NULL;
 out:
 	mutex_unlock(&wl->mutex);
 
@@ -1126,7 +1128,7 @@ power_off:
 	if (!booted) {
 		wl1271_error("firmware boot failed despite %d retries",
 			     WL1271_BOOT_RETRIES);
-		goto out;
+		goto out_free_fw;
 	}
 
 	wl->vif = vif;
@@ -1148,6 +1150,9 @@ power_off:
 	wl1271_debug(DEBUG_MAC80211, "11a is %ssupported",
 		     wl->enable_11a ? "" : "not ");
 
+out_free_fw:
+	vfree(wl->fw);
+	wl->fw = NULL;
 out:
 	mutex_unlock(&wl->mutex);
 
@@ -3300,8 +3305,6 @@ int wl1271_free_hw(struct wl1271 *wl)
 
 	wl1271_debugfs_exit(wl);
 
-	vfree(wl->fw);
-	wl->fw = NULL;
 	kfree(wl->nvs);
 	wl->nvs = NULL;
 
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux