linux-wireless.vger.kernel.org archive mirror
 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
  2018-12-23 11:28 ` Jia-Ju Bai
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ 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] 4+ messages in thread

* Re: [PATCH net-next] cw1200: fix missing unlock on error in cw1200_hw_scan()
  2018-12-22 10:34 [PATCH net-next] cw1200: fix missing unlock on error in cw1200_hw_scan() Wei Yongjun
@ 2018-12-23 11:28 ` Jia-Ju Bai
  2019-01-10 11:34 ` Kalle Valo
  2019-01-10 11:35 ` Kalle Valo
  2 siblings, 0 replies; 4+ messages in thread
From: Jia-Ju Bai @ 2018-12-23 11:28 UTC (permalink / raw)
  To: Wei Yongjun, Solomon Peachy, Kalle Valo; +Cc: linux-wireless, kernel-janitors

Oh, I forgot to handle the error case in my previous commit 4f68ef64cd7f...
Thanks for this patch :)

On 2018/12/22 18:34, Wei Yongjun wrote:
> 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);
>
>
>

Acked-by: Jia-Ju Bai <baijiaju1990@gmail.com>

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

* Re: [PATCH net-next] cw1200: fix missing unlock on error in cw1200_hw_scan()
  2018-12-22 10:34 [PATCH net-next] cw1200: fix missing unlock on error in cw1200_hw_scan() Wei Yongjun
  2018-12-23 11:28 ` Jia-Ju Bai
@ 2019-01-10 11:34 ` Kalle Valo
  2019-01-10 11:35 ` Kalle Valo
  2 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2019-01-10 11:34 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Solomon Peachy, Jia-Ju Bai, Wei Yongjun, linux-wireless, kernel-janitors

Wei Yongjun <weiyongjun1@huawei.com> wrote:

> 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>

cw1200 patches go to wireless-drivers-next, not net-next. In the future please
don't mark them for net-next to avoid any confusion.

-- 
https://patchwork.kernel.org/patch/10741431/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


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

* Re: [PATCH net-next] cw1200: fix missing unlock on error in cw1200_hw_scan()
  2018-12-22 10:34 [PATCH net-next] cw1200: fix missing unlock on error in cw1200_hw_scan() Wei Yongjun
  2018-12-23 11:28 ` Jia-Ju Bai
  2019-01-10 11:34 ` Kalle Valo
@ 2019-01-10 11:35 ` Kalle Valo
  2 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2019-01-10 11:35 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Solomon Peachy, Jia-Ju Bai, Wei Yongjun, linux-wireless, kernel-janitors

Wei Yongjun <weiyongjun1@huawei.com> wrote:

> 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>

Patch applied to wireless-drivers-next.git, thanks.

51c8d24101c7 cw1200: fix missing unlock on error in cw1200_hw_scan()

-- 
https://patchwork.kernel.org/patch/10741431/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


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

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

Thread overview: 4+ 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-23 11:28 ` Jia-Ju Bai
2019-01-10 11:34 ` Kalle Valo
2019-01-10 11:35 ` 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).