staging: rtl8723au: rtw_createbss_cmd23a_callback(): Relax holding of pmlmepriv-...
authorJes Sorensen <Jes.Sorensen@redhat.com>
Fri, 9 May 2014 13:03:45 +0000 (15:03 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 May 2014 20:11:59 +0000 (13:11 -0700)
We only really need to hold pmlmepriv->lock while calling
rtw_indicate_connect23a(). rtw_get_stainfo23a() and
rtw_alloc_stainfo23a() rely on pstapriv->sta_hash_lock and the non
WIFI_AP_STATE path relies on pmlmepvi->scanned_queue.lock, except we
need to used clr_fwstate() instead of _clr_fwstate_().

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723au/core/rtw_cmd.c

index 1ff945caa8f0434ba667e5722a3b657d5a239216..dc61a816e39b15bc1a763f9db328db4055634115 100644 (file)
@@ -1505,8 +1505,6 @@ void rtw_createbss_cmd23a_callback(struct rtw_adapter *padapter,
 
        del_timer_sync(&pmlmepriv->assoc_timer);
 
-       spin_lock_bh(&pmlmepriv->lock);
-
        if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
                psta = rtw_get_stainfo23a(&padapter->stapriv,
                                          pnetwork->MacAddress);
@@ -1521,7 +1519,9 @@ void rtw_createbss_cmd23a_callback(struct rtw_adapter *padapter,
                        }
                }
 
+               spin_lock_bh(&pmlmepriv->lock);
                rtw_indicate_connect23a(padapter);
+               spin_unlock_bh(&pmlmepriv->lock);
        } else {
                pwlan = rtw_alloc_network(pmlmepriv);
                spin_lock_bh(&pmlmepriv->scanned_queue.lock);
@@ -1554,7 +1554,7 @@ void rtw_createbss_cmd23a_callback(struct rtw_adapter *padapter,
 
                /*  reset DSConfig */
 
-               _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
+               clr_fwstate(pmlmepriv, _FW_UNDER_LINKING);
 
                spin_unlock_bh(&pmlmepriv->scanned_queue.lock);
                /*  we will set _FW_LINKED when there is one more sat to
@@ -1563,8 +1563,6 @@ void rtw_createbss_cmd23a_callback(struct rtw_adapter *padapter,
 
 createbss_cmd_fail:
 
-       spin_unlock_bh(&pmlmepriv->lock);
-
        rtw_free_cmd_obj23a(pcmd);
 }