staging: rtl8192e: Unlock mutex for one line in rtllib_stop_protocol()
authorPhilipp Hortmann <philipp.g.hortmann@gmail.com>
Sun, 24 Sep 2023 19:51:02 +0000 (21:51 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 26 Sep 2023 09:14:32 +0000 (11:14 +0200)
The following command uses the mutex ieee->wx_mutex:
cancel_delayed_work_sync(&ieee->associate_retry_wq)
Therefore it cannot be canceled with ieee->wx_mutex locked.
rtllib_stop_protocol() is always called with ieee->wx_mutex locked so
according line can be unlocked.

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

index c874468d075c461fa7e86dcedd8a7aaf98d27b3b..72d0225dfdf182af60e41360feb5203d0615c7d1 100644 (file)
@@ -2307,7 +2307,9 @@ void rtllib_stop_protocol(struct rtllib_device *ieee, u8 shutdown)
        }
 
        del_timer_sync(&ieee->associate_timer);
+       mutex_unlock(&ieee->wx_mutex);
        cancel_delayed_work_sync(&ieee->associate_retry_wq);
+       mutex_lock(&ieee->wx_mutex);
        cancel_delayed_work_sync(&ieee->link_change_wq);
        rtllib_stop_scan(ieee);