summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ti/wlcore/main.c
diff options
context:
space:
mode:
authorEliad Peller2012-07-25 13:22:21 +0200
committerLuciano Coelho2012-09-27 11:13:50 +0200
commit9b1a0a7771a62c3af4dce83e7cfd199367bd84ff (patch)
tree52ac2c43125b6bba0e5af7d002bd76fe2f0e8615 /drivers/net/wireless/ti/wlcore/main.c
parentwl18xx: update default phy configuration for pg2 (diff)
downloadkernel-qcow2-linux-9b1a0a7771a62c3af4dce83e7cfd199367bd84ff.tar.gz
kernel-qcow2-linux-9b1a0a7771a62c3af4dce83e7cfd199367bd84ff.tar.xz
kernel-qcow2-linux-9b1a0a7771a62c3af4dce83e7cfd199367bd84ff.zip
wlcore: consider single fw case
When a single fw is being used for both single-role and multi-role cases (e.g. 18xx), wl->mr_fw_name is NULL, which results in NULL dereference while trying to load the multi-role fw. In this case, always use the single-role fw, and avoid redundant fw switch by checking for this case in wl12xx_need_fw_change() as well. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <luca@coelho.fi>
Diffstat (limited to 'drivers/net/wireless/ti/wlcore/main.c')
-rw-r--r--drivers/net/wireless/ti/wlcore/main.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index 600af8e81904..f421c42b32ea 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -696,7 +696,7 @@ static int wl12xx_fetch_firmware(struct wl1271 *wl, bool plt)
* we can't call wl12xx_get_vif_count() here because
* wl->mutex is taken, so use the cached last_vif_count value
*/
- if (wl->last_vif_count > 1) {
+ if (wl->last_vif_count > 1 && wl->mr_fw_name) {
fw_type = WL12XX_FW_TYPE_MULTI;
fw_name = wl->mr_fw_name;
} else {
@@ -2170,6 +2170,10 @@ static bool wl12xx_need_fw_change(struct wl1271 *wl,
if (wl->state == WL1271_STATE_OFF)
return false;
+ /* no need for fw change if a single fw is used */
+ if (!wl->mr_fw_name)
+ return false;
+
if (vif_count > 1 && current_fw == WL12XX_FW_TYPE_NORMAL)
return true;
if (vif_count <= 1 && current_fw == WL12XX_FW_TYPE_MULTI)