From: Jes Sorensen Date: Mon, 9 Jun 2014 13:16:29 +0000 (+0200) Subject: staging: rtl8723au: Do not embed struct wlan_bssid_ex in struct survey_event X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=246879640e636256326221e70df8e1c3ef84ece0;p=openwrt%2Fstaging%2Fblogic.git staging: rtl8723au: Do not embed struct wlan_bssid_ex in struct survey_event 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8723au/core/rtw_mlme.c b/drivers/staging/rtl8723au/core/rtw_mlme.c index 639dfca9fe2f..71ff753b0d59 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme.c @@ -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; } diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c index 693a1a484072..9b6d918df3dd 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c @@ -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); diff --git a/drivers/staging/rtl8723au/include/rtw_event.h b/drivers/staging/rtl8723au/include/rtw_event.h index 807cc83bc710..4557aeccc604 100644 --- a/drivers/staging/rtl8723au/include/rtw_event.h +++ b/drivers/staging/rtl8723au/include/rtw_event.h @@ -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; }; /*