2023-05-03 15:10:51

by Dan Carpenter

[permalink] [raw]
Subject: [PATCH] wifi: rtw88: unlock on error path in rtw_ops_add_interface()

Call mutex_unlock(&rtwdev->mutex); before returning on this error path.

Fixes: f0e741e4ddbc ("wifi: rtw88: add bitmap for dynamic port settings")
Signed-off-by: Dan Carpenter <[email protected]>
---
drivers/net/wireless/realtek/rtw88/mac80211.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/realtek/rtw88/mac80211.c b/drivers/net/wireless/realtek/rtw88/mac80211.c
index 7aa6edad0d01..02cd19ee6e4c 100644
--- a/drivers/net/wireless/realtek/rtw88/mac80211.c
+++ b/drivers/net/wireless/realtek/rtw88/mac80211.c
@@ -173,8 +173,10 @@ static int rtw_ops_add_interface(struct ieee80211_hw *hw,
mutex_lock(&rtwdev->mutex);

port = find_first_zero_bit(rtwdev->hw_port, RTW_PORT_NUM);
- if (port >= RTW_PORT_NUM)
+ if (port >= RTW_PORT_NUM) {
+ mutex_unlock(&rtwdev->mutex);
return -EINVAL;
+ }
set_bit(port, rtwdev->hw_port);

rtwvif->port = port;
--
2.39.2


2023-05-04 01:32:47

by Ping-Ke Shih

[permalink] [raw]
Subject: RE: [PATCH] wifi: rtw88: unlock on error path in rtw_ops_add_interface()



> -----Original Message-----
> From: Dan Carpenter <[email protected]>
> Sent: Wednesday, May 3, 2023 11:10 PM
> To: Bernie Huang <[email protected]>
> Cc: Yan-Hsuan Chuang <[email protected]>; Kalle Valo <[email protected]>; Ping-Ke Shih
> <[email protected]>; [email protected]; [email protected]
> Subject: [PATCH] wifi: rtw88: unlock on error path in rtw_ops_add_interface()
>
> Call mutex_unlock(&rtwdev->mutex); before returning on this error path.
>
> Fixes: f0e741e4ddbc ("wifi: rtw88: add bitmap for dynamic port settings")
> Signed-off-by: Dan Carpenter <[email protected]>

Reviewed-by: Ping-Ke Shih <[email protected]>

[...]

2023-05-11 13:24:49

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH] wifi: rtw88: unlock on error path in rtw_ops_add_interface()

Dan Carpenter <[email protected]> wrote:

> Call mutex_unlock(&rtwdev->mutex); before returning on this error path.
>
> Fixes: f0e741e4ddbc ("wifi: rtw88: add bitmap for dynamic port settings")
> Signed-off-by: Dan Carpenter <[email protected]>
> Reviewed-by: Ping-Ke Shih <[email protected]>

Patch applied to wireless-next.git, thanks.

e2ff1181b3d4 wifi: rtw88: unlock on error path in rtw_ops_add_interface()

--
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

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