staging: rtl8192e: Put kfree() to end of rtllib_softmac_free()
authorPhilipp Hortmann <philipp.g.hortmann@gmail.com>
Sun, 24 Sep 2023 19:50:49 +0000 (21:50 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 26 Sep 2023 09:14:31 +0000 (11:14 +0200)
To reverse order of initialization put kfree() to the end of
rtllib_softmac_free().

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

index 982578e1c0af6fc627586a805890a75d379afb0b..d3468b646ca8a8d0ca35479f16f574a34d834b3c 100644 (file)
@@ -2462,8 +2462,6 @@ int rtllib_softmac_init(struct rtllib_device *ieee)
 void rtllib_softmac_free(struct rtllib_device *ieee)
 {
        mutex_lock(&ieee->wx_mutex);
-       kfree(ieee->dot11d_info);
-       ieee->dot11d_info = NULL;
        del_timer_sync(&ieee->associate_timer);
 
        cancel_delayed_work_sync(&ieee->associate_retry_wq);
@@ -2476,6 +2474,9 @@ void rtllib_softmac_free(struct rtllib_device *ieee)
        cancel_work_sync(&ieee->ips_leave_wq);
        cancel_work_sync(&ieee->wx_sync_scan_wq);
        cancel_work_sync(&ieee->ps_task);
+
+       kfree(ieee->dot11d_info);
+       ieee->dot11d_info = NULL;
        mutex_unlock(&ieee->wx_mutex);
 }