aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/staging/rtl8723au/core/rtw_ieee80211.c46
-rw-r--r--drivers/staging/rtl8723au/core/rtw_mlme_ext.c2
-rw-r--r--drivers/staging/rtl8723au/core/rtw_p2p.c4
-rw-r--r--drivers/staging/rtl8723au/core/rtw_wlan_util.c2
4 files changed, 16 insertions, 38 deletions
diff --git a/drivers/staging/rtl8723au/core/rtw_ieee80211.c b/drivers/staging/rtl8723au/core/rtw_ieee80211.c
index 780631fd3b6d..a48ab25a7d8a 100644
--- a/drivers/staging/rtl8723au/core/rtw_ieee80211.c
+++ b/drivers/staging/rtl8723au/core/rtw_ieee80211.c
@@ -1496,45 +1496,23 @@ void rtw_wlan_bssid_ex_remove_p2p_attr23a(struct wlan_bssid_ex *bss_ex, u8 attr_
1496int rtw_get_wfd_ie(u8 *in_ie, int in_len, u8 *wfd_ie, uint *wfd_ielen) 1496int rtw_get_wfd_ie(u8 *in_ie, int in_len, u8 *wfd_ie, uint *wfd_ielen)
1497{ 1497{
1498 int match; 1498 int match;
1499 uint cnt = 0; 1499 const u8 *ie;
1500 u8 eid, wfd_oui[4] = {0x50, 0x6F, 0x9A, 0x0A};
1501 1500
1502 match = false; 1501 match = 0;
1503 1502
1504 if (in_len < 0) { 1503 if (in_len < 0)
1505 return match; 1504 return match;
1506 }
1507
1508 while (cnt < in_len)
1509 {
1510 eid = in_ie[cnt];
1511 1505
1512 if ((eid == _VENDOR_SPECIFIC_IE_) && 1506 ie = cfg80211_find_vendor_ie(0x506F9A, 0x0A, in_ie, in_len);
1513 !memcmp(&in_ie[cnt+2], wfd_oui, 4)) { 1507 if (ie && (ie[1] <= (MAX_WFD_IE_LEN - 2))) {
1514 if (wfd_ie != NULL) { 1508 if (wfd_ie) {
1515 memcpy(wfd_ie, &in_ie[cnt], in_ie[cnt + 1] + 2); 1509 *wfd_ielen = ie[1] + 2;
1516 1510 memcpy(wfd_ie, ie, ie[1] + 2);
1517 } else { 1511 } else
1518 if (wfd_ielen != NULL) { 1512 if (wfd_ielen)
1519 *wfd_ielen = 0; 1513 *wfd_ielen = 0;
1520 }
1521 }
1522
1523 if (wfd_ielen != NULL) {
1524 *wfd_ielen = in_ie[cnt + 1] + 2;
1525 }
1526
1527 cnt += in_ie[cnt + 1] + 2;
1528
1529 match = true;
1530 break;
1531 } else {
1532 cnt += in_ie[cnt + 1] +2; /* goto next */
1533 }
1534 }
1535 1514
1536 if (match == true) { 1515 match = 1;
1537 match = cnt;
1538 } 1516 }
1539 1517
1540 return match; 1518 return match;
diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c
index 4c753639ea5a..1f3e8a0aece4 100644
--- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c
@@ -1281,7 +1281,7 @@ unsigned int OnAssocReq23a(struct rtw_adapter *padapter, struct recv_frame *prec
1281 u8 p2p_status_code = P2P_STATUS_SUCCESS; 1281 u8 p2p_status_code = P2P_STATUS_SUCCESS;
1282 u8 *p2pie; 1282 u8 *p2pie;
1283 u32 p2pielen = 0; 1283 u32 p2pielen = 0;
1284 u8 wfd_ie[ 128 ] = { 0x00 }; 1284 u8 wfd_ie[MAX_WFD_IE_LEN] = { 0x00 };
1285 u32 wfd_ielen = 0; 1285 u32 wfd_ielen = 0;
1286#endif /* CONFIG_8723AU_P2P */ 1286#endif /* CONFIG_8723AU_P2P */
1287 1287
diff --git a/drivers/staging/rtl8723au/core/rtw_p2p.c b/drivers/staging/rtl8723au/core/rtw_p2p.c
index 27a6cc76973d..1a961e3f3a55 100644
--- a/drivers/staging/rtl8723au/core/rtw_p2p.c
+++ b/drivers/staging/rtl8723au/core/rtw_p2p.c
@@ -2535,7 +2535,7 @@ u8 process_p2p_group_negotation_req23a(struct wifidirect_info *pwdinfo, u8 *pfra
2535 u16 wps_devicepassword_id = 0x0000; 2535 u16 wps_devicepassword_id = 0x0000;
2536 uint wps_devicepassword_id_len = 0; 2536 uint wps_devicepassword_id_len = 0;
2537#ifdef CONFIG_8723AU_P2P 2537#ifdef CONFIG_8723AU_P2P
2538 u8 wfd_ie[ 128 ] = { 0x00 }; 2538 u8 wfd_ie[MAX_WFD_IE_LEN] = { 0x00 };
2539 u32 wfd_ielen = 0; 2539 u32 wfd_ielen = 0;
2540#endif /* CONFIG_8723AU_P2P */ 2540#endif /* CONFIG_8723AU_P2P */
2541 2541
@@ -2741,7 +2741,7 @@ u8 process_p2p_group_negotation_resp23a(struct wifidirect_info *pwdinfo, u8 *pfr
2741 u32 ies_len; 2741 u32 ies_len;
2742 u8 * p2p_ie; 2742 u8 * p2p_ie;
2743#ifdef CONFIG_8723AU_P2P 2743#ifdef CONFIG_8723AU_P2P
2744 u8 wfd_ie[ 128 ] = { 0x00 }; 2744 u8 wfd_ie[MAX_WFD_IE_LEN] = { 0x00 };
2745 u32 wfd_ielen = 0; 2745 u32 wfd_ielen = 0;
2746#endif /* CONFIG_8723AU_P2P */ 2746#endif /* CONFIG_8723AU_P2P */
2747 2747
diff --git a/drivers/staging/rtl8723au/core/rtw_wlan_util.c b/drivers/staging/rtl8723au/core/rtw_wlan_util.c
index 0dfcfbce3b52..e743b053b8a2 100644
--- a/drivers/staging/rtl8723au/core/rtw_wlan_util.c
+++ b/drivers/staging/rtl8723au/core/rtw_wlan_util.c
@@ -570,7 +570,7 @@ void flush_all_cam_entry23a(struct rtw_adapter *padapter)
570int WFD_info_handler(struct rtw_adapter *padapter, struct ndis_802_11_var_ies * pIE) 570int WFD_info_handler(struct rtw_adapter *padapter, struct ndis_802_11_var_ies * pIE)
571{ 571{
572 struct wifidirect_info *pwdinfo; 572 struct wifidirect_info *pwdinfo;
573 u8 wfd_ie[128] = {0x00}; 573 u8 wfd_ie[MAX_WFD_IE_LEN] = {0x00};
574 u32 wfd_ielen = 0; 574 u32 wfd_ielen = 0;
575 575
576 pwdinfo = &padapter->wdinfo; 576 pwdinfo = &padapter->wdinfo;