Commit 2305232c authored by Philipp Hortmann's avatar Philipp Hortmann Committed by Greg Kroah-Hartman

staging: rtl8192e: Unlock wx_mutex not in rtllib_wx_set_scan

On start of rtllib_wx_set_scan lock was taken with
mutex_lock(&ieee->wx_mutex). Unlocking was done at the end of
schedule_work(&ieee->wx_sync_scan_wq) which lead to the error "lock held
when returning to user space!". Pushing lock to beginning of
ieee->wx_sync_scan_wq to improve overview. Removed lock from
rtllib_wx_set_scan as ieee->state, ieee->iw_mode and ieee->proto_started
are not protected in many other places.
Signed-off-by: default avatarPhilipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/20230516192206.GA7710@matrix-ESPRIMO-P710Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 35a70c03
...@@ -332,6 +332,7 @@ void rtllib_wx_sync_scan_wq(void *data) ...@@ -332,6 +332,7 @@ void rtllib_wx_sync_scan_wq(void *data)
enum ht_channel_width bandwidth = 0; enum ht_channel_width bandwidth = 0;
int b40M = 0; int b40M = 0;
mutex_lock(&ieee->wx_mutex);
if (!(ieee->softmac_features & IEEE_SOFTMAC_SCAN)) { if (!(ieee->softmac_features & IEEE_SOFTMAC_SCAN)) {
rtllib_start_scan_syncro(ieee, 0); rtllib_start_scan_syncro(ieee, 0);
goto out; goto out;
...@@ -404,8 +405,6 @@ int rtllib_wx_set_scan(struct rtllib_device *ieee, struct iw_request_info *a, ...@@ -404,8 +405,6 @@ int rtllib_wx_set_scan(struct rtllib_device *ieee, struct iw_request_info *a,
{ {
int ret = 0; int ret = 0;
mutex_lock(&ieee->wx_mutex);
if (ieee->iw_mode == IW_MODE_MONITOR || !(ieee->proto_started)) { if (ieee->iw_mode == IW_MODE_MONITOR || !(ieee->proto_started)) {
ret = -1; ret = -1;
goto out; goto out;
...@@ -418,7 +417,6 @@ int rtllib_wx_set_scan(struct rtllib_device *ieee, struct iw_request_info *a, ...@@ -418,7 +417,6 @@ int rtllib_wx_set_scan(struct rtllib_device *ieee, struct iw_request_info *a,
} }
out: out:
mutex_unlock(&ieee->wx_mutex);
return ret; return ret;
} }
EXPORT_SYMBOL(rtllib_wx_set_scan); EXPORT_SYMBOL(rtllib_wx_set_scan);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment