staging: rtl8192e: Exclude scan_mutex in rtllib_softmac_stop_scan
authorPhilipp Hortmann <philipp.g.hortmann@gmail.com>
Sun, 14 May 2023 20:40:33 +0000 (22:40 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 28 May 2023 09:11:34 +0000 (10:11 +0100)
Exclude scan_mutex from cancel_delayed_work_sync(&ieee->softmac_scan_wq) as
ieee->softmac_scan_wq takes scan_mutex as well.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/20230514204033.GA20187@matrix-ESPRIMO-P710
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192e/rtllib_softmac.c

index 18885cda60f62367b627ee15a46c67dbc19ab9c6..cb2dd18fa14b3c56969c2b18aed301d4e709dd16 100644 (file)
@@ -682,11 +682,11 @@ static void rtllib_softmac_stop_scan(struct rtllib_device *ieee)
        if (ieee->scanning_continue == 1) {
                ieee->scanning_continue = 0;
                ieee->actscanning = false;
-
+               mutex_unlock(&ieee->scan_mutex);
                cancel_delayed_work_sync(&ieee->softmac_scan_wq);
+       } else {
+               mutex_unlock(&ieee->scan_mutex);
        }
-
-       mutex_unlock(&ieee->scan_mutex);
 }
 
 void rtllib_stop_scan(struct rtllib_device *ieee)