staging: rtl8723au: Do not embed struct wlan_bssid_ex in struct survey_event
authorJes Sorensen <Jes.Sorensen@redhat.com>
Mon, 9 Jun 2014 13:16:29 +0000 (15:16 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jun 2014 21:00:19 +0000 (14:00 -0700)
Instead allocate it separately and reference it from survey_event.
This will allow for us to pass it on later without having to copy it.

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

index 639dfca9fe2f521953fdbc91c76ed02c46d57209..71ff753b0d59065213a08827f490f36d580a7da7 100644 (file)
@@ -640,7 +640,7 @@ void rtw_survey_event_cb23a(struct rtw_adapter *adapter, const u8 *pbuf)
        struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
        struct survey_event *survey = (struct survey_event *)pbuf;
 
-       pnetwork = &survey->bss;
+       pnetwork = survey->bss;
 
        RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,
                 ("rtw_survey_event_cb23a, ssid=%s\n", pnetwork->Ssid.ssid));
@@ -691,6 +691,9 @@ exit:
 
        spin_unlock_bh(&pmlmepriv->lock);
 
+       kfree(survey->bss);
+       survey->bss = NULL;
+
        return;
 }
 
index 693a1a4840724a105e0a048a93d40025575f0265..9b6d918df3dd3682d763fc6596f9b6683f650f4c 100644 (file)
@@ -4898,14 +4898,19 @@ void report_survey_event23a(struct rtw_adapter *padapter,
        pc2h_evt_hdr->seq = atomic_inc_return(&pmlmeext->event_seq);
 
        psurvey_evt = (struct survey_event*)(pevtcmd + sizeof(struct C2HEvent_Header));
+       psurvey_evt->bss = kzalloc(sizeof(struct wlan_bssid_ex), GFP_ATOMIC);
+       if (!psurvey_evt->bss) {
+               kfree(pcmd_obj);
+               kfree(pevtcmd);
+       }
 
-       if (collect_bss_info23a(padapter, precv_frame, &psurvey_evt->bss) == _FAIL) {
+       if (collect_bss_info23a(padapter, precv_frame, psurvey_evt->bss) == _FAIL) {
                kfree(pcmd_obj);
                kfree(pevtcmd);
                return;
        }
 
-       process_80211d(padapter, &psurvey_evt->bss);
+       process_80211d(padapter, psurvey_evt->bss);
 
        rtw_enqueue_cmd23a(pcmdpriv, pcmd_obj);
 
index 807cc83bc71010870dcf9dc8e43e82884bd4158c..4557aeccc6049ee56835683bab8116a19aa8d230 100644 (file)
@@ -22,7 +22,7 @@
 Used to report a bss has been scanned
 */
 struct survey_event {
-       struct wlan_bssid_ex bss;
+       struct wlan_bssid_ex *bss;
 };
 
 /*