summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/st
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2018-12-22 10:34:54 +0000
committerKalle Valo <kvalo@codeaurora.org>2019-01-10 13:35:02 +0200
commit51c8d24101c79ffce3e79137e2cee5dfeb956dd7 (patch)
treec57830d4ecefb07408a2dd76c19a1e2f95bd50df /drivers/net/wireless/st
parent4d95f99c59b8b814bcf09ba86020d937ec7caa86 (diff)
cw1200: fix missing unlock on error in cw1200_hw_scan()
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> Acked-by: Jia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/st')
-rw-r--r--drivers/net/wireless/st/cw1200/scan.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/wireless/st/cw1200/scan.c b/drivers/net/wireless/st/cw1200/scan.c
index 0a9eac93dd01..71e9b91cf15b 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);