Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH] wl12xx: free firmware after booting the chip
@ 2011-01-17 17:17 Eliad Peller
  2011-01-17 17:58 ` Johannes Berg
  0 siblings, 1 reply; 5+ messages in thread
From: Eliad Peller @ 2011-01-17 17:17 UTC (permalink / raw)
  To: Luciano Coelho; +Cc: linux-wireless

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

Signed-off-by: Eliad Peller <eliad@wizery.com>
---
 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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-01-17 19:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-17 17:17 [PATCH] wl12xx: free firmware after booting the chip Eliad Peller
2011-01-17 17:58 ` Johannes Berg
2011-01-17 18:11   ` Eliad Peller
2011-01-17 18:13     ` Johannes Berg
2011-01-17 19:32       ` Eliad Peller

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