hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/drivers/net/wireless/rockchip_wlan/rtl8723cs/os_dep/linux/ioctl_linux.c
....@@ -1059,7 +1059,7 @@
10591059 _rtw_memcpy(padapter->securitypriv.supplicant_ie, &buf[0], ielen);
10601060 }
10611061
1062
- if (rtw_parse_wpa2_ie(buf, ielen, &group_cipher, &pairwise_cipher, NULL, NULL, &mfp_opt, NULL) == _SUCCESS) {
1062
+ if (rtw_parse_wpa2_ie(buf, ielen, &group_cipher, &pairwise_cipher, NULL, NULL, &mfp_opt) == _SUCCESS) {
10631063 padapter->securitypriv.dot11AuthAlgrthm = dot11AuthAlgrthm_8021X;
10641064 padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeWPA2PSK;
10651065 _rtw_memcpy(padapter->securitypriv.supplicant_ie, &buf[0], ielen);
....@@ -4319,7 +4319,6 @@
43194319
43204320 wpsie = rtw_get_wps_ie_from_scan_queue(&pnetwork->network.IEs[0], pnetwork->network.IELength, NULL, &wpsie_len, pnetwork->network.Reserved[0]);
43214321 if (wpsie) {
4322
- attr_contentlen = sizeof(attr_content);
43234322 rtw_get_wps_attr_content(wpsie, wpsie_len, WPS_ATTR_CONF_METHOD, (u8 *)&attr_content, &attr_contentlen);
43244323 if (attr_contentlen) {
43254324 attr_content = be16_to_cpu(attr_content);
....@@ -4453,7 +4452,6 @@
44534452 /* The P2P Device Info attribute is included in the probe response frame. */
44544453
44554454 _rtw_memset(attr_content, 0x00, 100);
4456
- attr_contentlen = sizeof(attr_content);
44574455 if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_DEVICE_ID, attr_content, &attr_contentlen)) {
44584456 /* Handle the P2P Device ID attribute of Beacon first */
44594457 blnMatch = 1;
....@@ -4536,7 +4534,6 @@
45364534
45374535 wpsie = rtw_get_wps_ie_from_scan_queue(&pnetwork->network.IEs[0], pnetwork->network.IELength, NULL, &wpsie_len, pnetwork->network.Reserved[0]);
45384536 if (wpsie) {
4539
- dev_type_len = sizeof(dev_type);
45404537 rtw_get_wps_attr_content(wpsie, wpsie_len, WPS_ATTR_PRIMARY_DEV_TYPE, dev_type, &dev_type_len);
45414538 if (dev_type_len) {
45424539 u16 type = 0;
....@@ -4611,7 +4608,6 @@
46114608
46124609 wpsie = rtw_get_wps_ie_from_scan_queue(&pnetwork->network.IEs[0], pnetwork->network.IELength, NULL, &wpsie_len, pnetwork->network.Reserved[0]);
46134610 if (wpsie) {
4614
- dev_len = sizeof(dev_name);
46154611 rtw_get_wps_attr_content(wpsie, wpsie_len, WPS_ATTR_DEVICE_NAME, dev_name, &dev_len);
46164612 if (dev_len) {
46174613 sprintf(dev_name_str, "\n\nN=%s", dev_name);
....@@ -4652,7 +4648,7 @@
46524648 struct wlan_network *pnetwork = NULL;
46534649 u8 blnMatch = 0;
46544650 u8 *p2pie;
4655
- uint p2pielen = 0, attr_contentlen = 2;
4651
+ uint p2pielen = 0, attr_contentlen = 0;
46564652 u8 attr_content[2] = { 0x00 };
46574653 u8 inv_proc_str[P2P_PRIVATE_IOCTL_SET_LEN] = { 0x00 };
46584654
....@@ -4683,7 +4679,6 @@
46834679 if (p2pie) {
46844680 while (p2pie) {
46854681 /* _rtw_memset( attr_content, 0x00, 2); */
4686
- attr_contentlen = sizeof(attr_content);
46874682 if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_CAPABILITY, attr_content, &attr_contentlen)) {
46884683 /* Handle the P2P capability attribute */
46894684 blnMatch = 1;
....@@ -4856,7 +4851,7 @@
48564851 uint uintPeerChannel = 0;
48574852 u8 attr_content[50] = { 0x00 };
48584853 u8 *p2pie;
4859
- uint p2pielen = 0, attr_contentlen = 50;
4854
+ uint p2pielen = 0, attr_contentlen = 0;
48604855 _irqL irqL;
48614856 struct tx_invite_req_info *pinvite_req_info = &pwdinfo->invitereq_info;
48624857 #ifdef CONFIG_CONCURRENT_MODE
....@@ -4914,7 +4909,6 @@
49144909 /* The P2P Device ID attribute is included in the Beacon frame. */
49154910 /* The P2P Device Info attribute is included in the probe response frame. */
49164911
4917
- attr_contentlen = sizeof(attr_content);
49184912 if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_DEVICE_ID, attr_content, &attr_contentlen)) {
49194913 /* Handle the P2P Device ID attribute of Beacon first */
49204914 if (_rtw_memcmp(attr_content, pinvite_req_info->peer_macaddr, ETH_ALEN)) {
....@@ -5130,7 +5124,7 @@
51305124 struct wlan_network *pnetwork = NULL;
51315125 u8 attr_content[50] = { 0x00 };
51325126 u8 *p2pie;
5133
- uint p2pielen = 0, attr_contentlen = 50;
5127
+ uint p2pielen = 0, attr_contentlen = 0;
51345128 _irqL irqL;
51355129 uint uintPeerChannel = 0;
51365130
....@@ -5170,7 +5164,6 @@
51705164 /* The P2P Device ID attribute is included in the Beacon frame. */
51715165 /* The P2P Device Info attribute is included in the probe response frame. */
51725166 printk("[%s] Got P2P IE\n", __FUNCTION__);
5173
- attr_contentlen = sizeof(attr_content);
51745167 if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_DEVICE_ID, attr_content, &attr_contentlen)) {
51755168 /* Handle the P2P Device ID attribute of Beacon first */
51765169 printk("[%s] P2P_ATTR_DEVICE_ID\n", __FUNCTION__);
....@@ -5343,7 +5336,7 @@
53435336 uint uintPeerChannel = 0;
53445337 u8 attr_content[100] = { 0x00 };
53455338 u8 *p2pie;
5346
- uint p2pielen = 0, attr_contentlen = 100;
5339
+ uint p2pielen = 0, attr_contentlen = 0;
53475340 _irqL irqL;
53485341 #ifdef CONFIG_CONCURRENT_MODE
53495342 struct roch_info *prochinfo = &padapter->rochinfo;
....@@ -5412,7 +5405,7 @@
54125405 while (p2pie) {
54135406 /* The P2P Device ID attribute is included in the Beacon frame. */
54145407 /* The P2P Device Info attribute is included in the probe response frame. */
5415
- attr_contentlen = sizeof(attr_content);
5408
+
54165409 if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_DEVICE_ID, attr_content, &attr_contentlen)) {
54175410 /* Handle the P2P Device ID attribute of Beacon first */
54185411 if (_rtw_memcmp(attr_content, peerMAC, ETH_ALEN)) {
....@@ -12893,6 +12886,11 @@
1289312886 extra = buffer;
1289412887
1289512888 handler = priv[priv_args[k].cmd - SIOCIWFIRSTPRIV];
12889
+ if (handler == NULL) {
12890
+ err = -EINVAL;
12891
+ goto exit;
12892
+ }
12893
+
1289612894 err = handler(dev, NULL, &wdata, extra);
1289712895
1289812896 /* If we have to get some data */