Skip to contentSkip to conversation

Set wlvif->ps_compl to NULL in before return

PATCH In review Pontus Fuchs 3 participants 3 messages Dec 14, 2011 – Dec 15, 2011 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Set wlvif->ps_compl to NULL in before return

wl1271_configure_suspend_sta leaves a stale stack declared completion in wlvif->ps_compl. Set it to NULL before returning.

---
 drivers/net/wireless/wl12xx/main.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
drivers/net/wireless/wl12xx/main.c +6 -6
index 2f7bfa8..b9e506d 100644
@@ -1585,24 +1585,24 @@ static int wl1271_configure_suspend_sta(struct wl1271 *wl,
 
 		ret = wait_for_completion_timeout(
 			&compl, msecs_to_jiffies(WL1271_PS_COMPLETE_TIMEOUT));
+
+		mutex_lock(&wl->mutex);
 		if (ret <= 0) {
 			wl1271_warning("couldn't enter ps mode!");
 			ret = -EBUSY;
-			goto out;
+			goto out_cleanup;
 		}
 
-		/* take mutex again, and wakeup */
-		mutex_lock(&wl->mutex);
-
 		ret = wl1271_ps_elp_wakeup(wl);
 		if (ret < 0)
-			goto out_unlock;
+			goto out_cleanup;
 	}
 out_sleep:
 	wl1271_ps_elp_sleep(wl);
+out_cleanup:
+	wl->ps_compl = NULL;
 out_unlock:
 	mutex_unlock(&wl->mutex);
-out:
 	return ret;
 
 }
Signature · 1 line
1.7.5.4
#1 lore raw
Quoted 5 lines · Pontus Fuchs

wl1271_configure_suspend_sta leaves a stale stack declared completion in wlvif->ps_compl. Set it to NULL before returning.

---

Applied with a small fix. wl->ps_compl was used, which doesn't exist anymore. I changed it to wlvif->ps_compl before applying.

Signature · 2 lines
Cheers,
Luca.
#2 lore raw
Quoted 9 lines · Luciano Coelho
Quoted 5 lines · Pontus Fuchs

wl1271_configure_suspend_sta leaves a stale stack declared completion in wlvif->ps_compl. Set it to NULL before returning.

---

Applied with a small fix. wl->ps_compl was used, which doesn't exist anymore. I changed it to wlvif->ps_compl before applying.

Thanks :) I Messed up when moving the code to your latest tree.

-ETOMANYTREES or something

Cheers,

Pontus