Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: r8188eu: Remove broken rtw_p2p_get function.

Removes broken and unsafe rtw_p2p_get function and all of the code
associated with it from the r8188eu driver.

Signed-off-by: Charlie Sands <charlies256@protonmail.com>
Link: https://lore.kernel.org/r/Ymy7C/A2q+VzfBhO@sckzor-linux.localdomain
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Charlie Sands and committed by
Greg Kroah-Hartman
72b901c1 3136dc60

+1 -135
+1 -135
drivers/staging/r8188eu/os_dep/ioctl_linux.c
··· 2363 2363 pwdinfo->device_name_len = wrqu->data.length - 1; 2364 2364 } 2365 2365 2366 - static void rtw_p2p_get_status(struct net_device *dev, 2367 - struct iw_request_info *info, 2368 - union iwreq_data *wrqu, char *extra) 2369 - { 2370 - struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); 2371 - struct wifidirect_info *pwdinfo = &padapter->wdinfo; 2372 - 2373 - /* Commented by Albert 2010/10/12 */ 2374 - /* Because of the output size limitation, I had removed the "Role" information. */ 2375 - /* About the "Role" information, we will use the new private IOCTL to get the "Role" information. */ 2376 - sprintf(extra, "\n\nStatus =%.2d\n", rtw_p2p_state(pwdinfo)); 2377 - wrqu->data.length = strlen(extra); 2378 - } 2379 - 2380 - /* Commented by Albert 20110520 */ 2381 - /* This function will return the config method description */ 2382 - /* This config method description will show us which config method the remote P2P device is intended to use */ 2383 - /* by sending the provisioning discovery request frame. */ 2384 - 2385 - static void rtw_p2p_get_req_cm(struct net_device *dev, 2386 - struct iw_request_info *info, 2387 - union iwreq_data *wrqu, char *extra) 2388 - { 2389 - struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); 2390 - struct wifidirect_info *pwdinfo = &padapter->wdinfo; 2391 - 2392 - sprintf(extra, "\n\nCM =%s\n", pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req); 2393 - wrqu->data.length = strlen(extra); 2394 - } 2395 - 2396 - static void rtw_p2p_get_role(struct net_device *dev, 2397 - struct iw_request_info *info, 2398 - union iwreq_data *wrqu, char *extra) 2399 - { 2400 - struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); 2401 - struct wifidirect_info *pwdinfo = &padapter->wdinfo; 2402 - 2403 - sprintf(extra, "\n\nRole =%.2d\n", rtw_p2p_role(pwdinfo)); 2404 - wrqu->data.length = strlen(extra); 2405 - } 2406 - 2407 - static void rtw_p2p_get_peer_ifaddr(struct net_device *dev, 2408 - struct iw_request_info *info, 2409 - union iwreq_data *wrqu, char *extra) 2410 - { 2411 - struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); 2412 - struct wifidirect_info *pwdinfo = &padapter->wdinfo; 2413 - 2414 - sprintf(extra, "\nMAC %pM", 2415 - pwdinfo->p2p_peer_interface_addr); 2416 - wrqu->data.length = strlen(extra); 2417 - } 2418 - 2419 - static void rtw_p2p_get_peer_devaddr(struct net_device *dev, 2420 - struct iw_request_info *info, 2421 - union iwreq_data *wrqu, char *extra) 2422 - 2423 - { 2424 - struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); 2425 - struct wifidirect_info *pwdinfo = &padapter->wdinfo; 2426 - 2427 - sprintf(extra, "\n%pM", 2428 - pwdinfo->rx_prov_disc_info.peerDevAddr); 2429 - wrqu->data.length = strlen(extra); 2430 - } 2431 - 2432 - static void rtw_p2p_get_peer_devaddr_by_invitation(struct net_device *dev, 2433 - struct iw_request_info *info, 2434 - union iwreq_data *wrqu, 2435 - char *extra) 2436 - 2437 - { 2438 - struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); 2439 - struct wifidirect_info *pwdinfo = &padapter->wdinfo; 2440 - 2441 - sprintf(extra, "\nMAC %pM", 2442 - pwdinfo->p2p_peer_device_addr); 2443 - wrqu->data.length = strlen(extra); 2444 - } 2445 - 2446 - static void rtw_p2p_get_groupid(struct net_device *dev, 2447 - struct iw_request_info *info, 2448 - union iwreq_data *wrqu, char *extra) 2449 - 2450 - { 2451 - struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); 2452 - struct wifidirect_info *pwdinfo = &padapter->wdinfo; 2453 - 2454 - sprintf(extra, "\n%.2X:%.2X:%.2X:%.2X:%.2X:%.2X %s", 2455 - pwdinfo->groupid_info.go_device_addr[0], pwdinfo->groupid_info.go_device_addr[1], 2456 - pwdinfo->groupid_info.go_device_addr[2], pwdinfo->groupid_info.go_device_addr[3], 2457 - pwdinfo->groupid_info.go_device_addr[4], pwdinfo->groupid_info.go_device_addr[5], 2458 - pwdinfo->groupid_info.ssid); 2459 - wrqu->data.length = strlen(extra); 2460 - } 2461 - 2462 - static void rtw_p2p_get_op_ch(struct net_device *dev, 2463 - struct iw_request_info *info, 2464 - union iwreq_data *wrqu, char *extra) 2465 - 2466 - { 2467 - struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); 2468 - struct wifidirect_info *pwdinfo = &padapter->wdinfo; 2469 - 2470 - sprintf(extra, "\n\nOp_ch =%.2d\n", pwdinfo->operating_channel); 2471 - wrqu->data.length = strlen(extra); 2472 - } 2473 - 2474 2366 static int rtw_p2p_get_wps_configmethod(struct net_device *dev, 2475 2367 struct iw_request_info *info, 2476 2368 union iwreq_data *wrqu, char *extra) ··· 3121 3229 return ret; 3122 3230 } 3123 3231 3124 - static int rtw_p2p_get(struct net_device *dev, 3125 - struct iw_request_info *info, 3126 - union iwreq_data *wrqu, char *extra) 3127 - { 3128 - if (!memcmp(wrqu->data.pointer, "status", 6)) { 3129 - rtw_p2p_get_status(dev, info, wrqu, extra); 3130 - } else if (!memcmp(wrqu->data.pointer, "role", 4)) { 3131 - rtw_p2p_get_role(dev, info, wrqu, extra); 3132 - } else if (!memcmp(wrqu->data.pointer, "peer_ifa", 8)) { 3133 - rtw_p2p_get_peer_ifaddr(dev, info, wrqu, extra); 3134 - } else if (!memcmp(wrqu->data.pointer, "req_cm", 6)) { 3135 - rtw_p2p_get_req_cm(dev, info, wrqu, extra); 3136 - } else if (!memcmp(wrqu->data.pointer, "peer_deva", 9)) { 3137 - /* Get the P2P device address when receiving the provision discovery request frame. */ 3138 - rtw_p2p_get_peer_devaddr(dev, info, wrqu, extra); 3139 - } else if (!memcmp(wrqu->data.pointer, "group_id", 8)) { 3140 - rtw_p2p_get_groupid(dev, info, wrqu, extra); 3141 - } else if (!memcmp(wrqu->data.pointer, "peer_deva_inv", 9)) { 3142 - /* Get the P2P device address when receiving the P2P Invitation request frame. */ 3143 - rtw_p2p_get_peer_devaddr_by_invitation(dev, info, wrqu, extra); 3144 - } else if (!memcmp(wrqu->data.pointer, "op_ch", 5)) { 3145 - rtw_p2p_get_op_ch(dev, info, wrqu, extra); 3146 - } 3147 - return 0; 3148 - } 3149 - 3150 3232 static int rtw_p2p_get2(struct net_device *dev, 3151 3233 struct iw_request_info *info, 3152 3234 union iwreq_data *wrqu, char *extra) ··· 3795 3929 NULL, /* 0x0F */ 3796 3930 3797 3931 rtw_p2p_set, /* 0x10 */ 3798 - rtw_p2p_get, /* 0x11 */ 3932 + NULL, /* 0x11 */ 3799 3933 rtw_p2p_get2, /* 0x12 */ 3800 3934 3801 3935 NULL, /* 0x13 */