All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] cw1200: fix missing unlock on error in cw1200_hw_scan()
@ 2018-12-22 10:34 ` Wei Yongjun
  0 siblings, 0 replies; 8+ messages in thread
From: Wei Yongjun @ 2018-12-22 10:34 UTC (permalink / raw)
  To: Solomon Peachy, Kalle Valo, Jia-Ju Bai
  Cc: Wei Yongjun, linux-wireless, kernel-janitors

Add the missing unlock before return from function cw1200_hw_scan()
in the error handling case.

Fixes: 4f68ef64cd7f ("cw1200: Fix concurrency use-after-free bugs in cw1200_hw_scan()")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/net/wireless/st/cw1200/scan.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/st/cw1200/scan.c b/drivers/net/wireless/st/cw1200/scan.c
index 0a9eac9..71e9b91 100644
--- a/drivers/net/wireless/st/cw1200/scan.c
+++ b/drivers/net/wireless/st/cw1200/scan.c
@@ -84,8 +84,11 @@ int cw1200_hw_scan(struct ieee80211_hw *hw,
 
 	frame.skb = ieee80211_probereq_get(hw, priv->vif->addr, NULL, 0,
 		req->ie_len);
-	if (!frame.skb)
+	if (!frame.skb) {
+		mutex_unlock(&priv->conf_mutex);
+		up(&priv->scan.lock);
 		return -ENOMEM;
+	}
 
 	if (req->ie_len)
 		skb_put_data(frame.skb, req->ie, req->ie_len);

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

end of thread, other threads:[~2019-01-10 11:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-22 10:34 [PATCH net-next] cw1200: fix missing unlock on error in cw1200_hw_scan() Wei Yongjun
2018-12-22 10:34 ` Wei Yongjun
2018-12-23 11:28 ` Jia-Ju Bai
2018-12-23 11:28   ` Jia-Ju Bai
2019-01-10 11:34 ` Kalle Valo
2019-01-10 11:34   ` Kalle Valo
2019-01-10 11:35 ` Kalle Valo
2019-01-10 11:35   ` Kalle Valo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.