linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] wlcore: unlock on error in wl1271_op_suspend()
@ 2015-01-15 11:43 Dan Carpenter
  2015-01-15 12:34 ` Eliad Peller
  2015-01-23 17:38 ` Kalle Valo
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2015-01-15 11:43 UTC (permalink / raw)
  To: Kalle Valo, Ram Amrani
  Cc: Eliad Peller, John W. Linville, Arik Nemtsov, Johannes Berg,
	David Spinadel, Luciano Coelho, linux-wireless, kernel-janitors

We recently introduced a new error path which needs an unlock.

Fixes: 6d5a748d4836 ('wlcore: add ability to reduce FW interrupts during suspend')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
Static checker fix.  It's possible that wl1271_ps_elp_wakeup() unlocks
on error but I didn't see it, and that would be an ugly API.

diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index e90fb78..02f0e86 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -1785,8 +1785,10 @@ static int wl1271_op_suspend(struct ieee80211_hw *hw,
 	mutex_lock(&wl->mutex);
 
 	ret = wl1271_ps_elp_wakeup(wl);
-	if (ret < 0)
+	if (ret < 0) {
+		mutex_unlock(&wl->mutex);
 		return ret;
+	}
 
 	wl->wow_enabled = true;
 	wl12xx_for_each_wlvif(wl, wlvif) {

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

end of thread, other threads:[~2015-01-23 17:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-15 11:43 [patch] wlcore: unlock on error in wl1271_op_suspend() Dan Carpenter
2015-01-15 12:34 ` Eliad Peller
2015-01-23 17:38 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).