Re: [PATCH] staging: rtl8188eu: Fix private WEXT IOCTL calls

From: kbuild test robot
Date: Sun Nov 26 2017 - 18:23:30 EST


Hi Ishraq,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on staging/staging-testing]
[also build test ERROR on v4.14 next-20171124]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/ishraq-i-ashraf-gmail-com/staging-rtl8188eu-Fix-private-WEXT-IOCTL-calls/20171126-052554
config: x86_64-randconfig-u0-11270543 (attached as .config)
compiler: gcc-5 (Debian 5.5.0-3) 5.4.1 20171010
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64

All errors (new ones prefixed by >>):

drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function 'rtw_hostapd_sta_flush_pvt':
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3101:9: error: implicit declaration of function 'rtw_sta_flush' [-Werror=implicit-function-declaration]
return rtw_sta_flush(padapter);
^
In file included from include/linux/kernel.h:14:0,
from include/linux/skbuff.h:17,
from include/linux/if_ether.h:23,
from include/linux/ieee80211.h:21,
from drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:17:
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function 'rtw_add_sta_pvt':
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3133:49: error: 'union <anonymous>' has no member named 'add_sta'
DBG_88E("rtw_add_sta(aid =%d) =%pM\n", param->u.add_sta.aid, (param->sta_addr));
^
include/linux/printk.h:310:34: note: in definition of macro 'pr_info'
printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3133:2: note: in expansion of macro 'DBG_88E'
DBG_88E("rtw_add_sta(aid =%d) =%pM\n", param->u.add_sta.aid, (param->sta_addr));
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3145:23: error: 'union <anonymous>' has no member named 'add_sta'
int flags = param->u.add_sta.flags;
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3146:23: error: 'union <anonymous>' has no member named 'add_sta'
psta->aid = param->u.add_sta.aid; // aid = 1~2007.
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3148:36: error: 'union <anonymous>' has no member named 'add_sta'
memcpy(psta->bssrateset, param->u.add_sta.tx_supp_rates, 16);
^
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3151:7: error: 'WLAN_STA_WME' undeclared (first use in this function)
if (WLAN_STA_WME&flags)
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3151:7: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3160:7: error: 'WLAN_STA_HT' undeclared (first use in this function)
if (WLAN_STA_HT&flags) {
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3164:20: error: 'union <anonymous>' has no member named 'add_sta'
&param->u.add_sta.ht_cap,
^
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3173:3: error: implicit declaration of function 'update_sta_info_apmode' [-Werror=implicit-function-declaration]
update_sta_info_apmode(padapter, psta);
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function 'rtw_del_sta_pvt':
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3229:12: error: 'struct sta_priv' has no member named 'asoc_list_cnt'
pstapriv->asoc_list_cnt--;
^
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3230:14: error: implicit declaration of function 'ap_free_sta' [-Werror=implicit-function-declaration]
updated = ap_free_sta(padapter, psta, true, WLAN_REASON_DEAUTH_LEAVING);
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3233:3: error: implicit declaration of function 'associated_clients_update' [-Werror=implicit-function-declaration]
associated_clients_update(padapter, updated);
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function 'rtw_set_beacon_pvt':
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3276:17: error: 'union <anonymous>' has no member named 'bcn_ie'
pbuf = param->u.bcn_ie.buf;
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3283:18: error: 'struct sta_priv' has no member named 'max_num_sta'
memcpy(&pstapriv->max_num_sta, param->u.bcn_ie.reserved, 2);
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3283:41: error: 'union <anonymous>' has no member named 'bcn_ie'
memcpy(&pstapriv->max_num_sta, param->u.bcn_ie.reserved, 2);
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3285:15: error: 'struct sta_priv' has no member named 'max_num_sta'
if ((pstapriv->max_num_sta > NUM_STA) || (pstapriv->max_num_sta <= 0))
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3285:52: error: 'struct sta_priv' has no member named 'max_num_sta'
if ((pstapriv->max_num_sta > NUM_STA) || (pstapriv->max_num_sta <= 0))
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3286:11: error: 'struct sta_priv' has no member named 'max_num_sta'
pstapriv->max_num_sta = NUM_STA;
^
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3288:6: error: implicit declaration of function 'rtw_check_beacon_data' [-Werror=implicit-function-declaration]
if (rtw_check_beacon_data(padapter, pbuf, (len-12-2)) == _SUCCESS) // 12 = Param header, 2 = Not packed.
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function 'rtw_set_encryption_pvt':
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3412:4: error: implicit declaration of function 'set_wep_key' [-Werror=implicit-function-declaration]
set_wep_key(padapter, pwep->KeyMaterial, pwep->KeyLength, wep_key_idx);
^
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3476:4: error: implicit declaration of function 'set_group_key' [-Werror=implicit-function-declaration]
set_group_key(padapter, param->u.crypt.key, psecuritypriv->dot118021XGrpPrivacy, param->u.crypt.idx);
^
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3517:5: error: implicit declaration of function 'set_pairwise_key' [-Werror=implicit-function-declaration]
set_pairwise_key(padapter, psta);
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function 'rtw_get_sta_wpaie_pvt':
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3621:11: error: 'struct sta_info' has no member named 'wpa_ie'
if (psta->wpa_ie[0] == WLAN_EID_RSN ||
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3622:11: error: 'struct sta_info' has no member named 'wpa_ie'
psta->wpa_ie[0] == WLAN_EID_VENDOR_SPECIFIC) {
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3626:26: error: 'struct sta_info' has no member named 'wpa_ie'
wpa_ie_len = psta->wpa_ie[1];
^
In file included from include/linux/skbuff.h:17:0,
from include/linux/if_ether.h:23,
from include/linux/ieee80211.h:21,
from drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:17:
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3627:58: error: 'struct sta_info' has no member named 'wpa_ie'
copy_len = min_t(int, wpa_ie_len + 2, sizeof(psta->wpa_ie));
^
include/linux/kernel.h:790:13: note: in definition of macro '__min'
t2 min2 = (y); \
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3627:20: note: in expansion of macro 'min_t'
copy_len = min_t(int, wpa_ie_len + 2, sizeof(psta->wpa_ie));
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3629:46: error: 'struct sta_info' has no member named 'wpa_ie'
memcpy(param->u.wpa_ie.reserved, psta->wpa_ie, copy_len);
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function 'rtw_set_wps_beacon_pvt':
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3682:17: error: 'struct mlme_priv' has no member named 'wps_beacon_ie'
kfree(pmlmepriv->wps_beacon_ie);
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3683:11: error: 'struct mlme_priv' has no member named 'wps_beacon_ie'
pmlmepriv->wps_beacon_ie = NULL;
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3686:12: error: 'struct mlme_priv' has no member named 'wps_beacon_ie'
pmlmepriv->wps_beacon_ie = rtw_malloc(ie_len);
^
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3687:12: error: 'struct mlme_priv' has no member named 'wps_beacon_ie_len'
pmlmepriv->wps_beacon_ie_len = ie_len;
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3688:17: error: 'struct mlme_priv' has no member named 'wps_beacon_ie'
if (!pmlmepriv->wps_beacon_ie) {
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3693:19: error: 'struct mlme_priv' has no member named 'wps_beacon_ie'
memcpy(pmlmepriv->wps_beacon_ie, param->u.bcn_ie.buf, ie_len);
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3693:44: error: 'union <anonymous>' has no member named 'bcn_ie'
memcpy(pmlmepriv->wps_beacon_ie, param->u.bcn_ie.buf, ie_len);
^
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3694:3: error: implicit declaration of function 'update_beacon' [-Werror=implicit-function-declaration]
update_beacon(padapter, _VENDOR_SPECIFIC_IE_, wps_oui, true);
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3696:11: error: 'struct mlme_ext_priv' has no member named 'bstart_bss'
pmlmeext->bstart_bss = true;
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function 'rtw_set_wps_probe_resp_pvt':
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3742:17: error: 'struct mlme_priv' has no member named 'wps_probe_resp_ie'
kfree(pmlmepriv->wps_probe_resp_ie);
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3743:11: error: 'struct mlme_priv' has no member named 'wps_probe_resp_ie'
pmlmepriv->wps_probe_resp_ie = NULL;
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3746:12: error: 'struct mlme_priv' has no member named 'wps_probe_resp_ie'
pmlmepriv->wps_probe_resp_ie = rtw_malloc(ie_len);
^
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3747:12: error: 'struct mlme_priv' has no member named 'wps_probe_resp_ie_len'
pmlmepriv->wps_probe_resp_ie_len = ie_len;
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3748:17: error: 'struct mlme_priv' has no member named 'wps_probe_resp_ie'
if (!pmlmepriv->wps_probe_resp_ie) {
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3752:19: error: 'struct mlme_priv' has no member named 'wps_probe_resp_ie'
memcpy(pmlmepriv->wps_probe_resp_ie, param->u.bcn_ie.buf, ie_len);
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3752:48: error: 'union <anonymous>' has no member named 'bcn_ie'
memcpy(pmlmepriv->wps_probe_resp_ie, param->u.bcn_ie.buf, ie_len);
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function 'rtw_set_wps_assoc_resp_pvt':
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3798:17: error: 'struct mlme_priv' has no member named 'wps_assoc_resp_ie'
kfree(pmlmepriv->wps_assoc_resp_ie);
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3799:11: error: 'struct mlme_priv' has no member named 'wps_assoc_resp_ie'
pmlmepriv->wps_assoc_resp_ie = NULL;
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3802:12: error: 'struct mlme_priv' has no member named 'wps_assoc_resp_ie'
pmlmepriv->wps_assoc_resp_ie = rtw_malloc(ie_len);
^
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3803:12: error: 'struct mlme_priv' has no member named 'wps_assoc_resp_ie_len'
pmlmepriv->wps_assoc_resp_ie_len = ie_len;
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3804:17: error: 'struct mlme_priv' has no member named 'wps_assoc_resp_ie'
if (!pmlmepriv->wps_assoc_resp_ie) {
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3809:19: error: 'struct mlme_priv' has no member named 'wps_assoc_resp_ie'
memcpy(pmlmepriv->wps_assoc_resp_ie, param->u.bcn_ie.buf, ie_len);
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3809:48: error: 'union <anonymous>' has no member named 'bcn_ie'
memcpy(pmlmepriv->wps_assoc_resp_ie, param->u.bcn_ie.buf, ie_len);
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function 'rtw_ioctl_get_sta_data_pvt':
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3898:41: error: dereferencing pointer to incomplete type 'struct ieee_param_ex'
psta_data = (struct sta_data *)param_ex->data;
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3912:12: error: dereferencing pointer to incomplete type 'struct sta_data'
psta_data->aid = (u16)psta->aid;
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3913:31: error: 'struct sta_info' has no member named 'capability'
psta_data->capability = psta->capability;
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3914:26: error: 'struct sta_info' has no member named 'flags'
psta_data->flags = psta->flags;
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3926:10: error: 'struct sta_info' has no member named 'nonerp_set'
((psta->nonerp_set) |
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3927:9: error: 'struct sta_info' has no member named 'no_short_slot_time_set'
(psta->no_short_slot_time_set << 1) |
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3928:9: error: 'struct sta_info' has no member named 'no_short_preamble_set'
(psta->no_short_preamble_set << 2) |
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3929:9: error: 'struct sta_info' has no member named 'no_ht_gf_set'
(psta->no_ht_gf_set << 3) |
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3930:9: error: 'struct sta_info' has no member named 'no_ht_set'
(psta->no_ht_set << 4) |
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3931:9: error: 'struct sta_info' has no member named 'ht_20mhz_set'
(psta->ht_20mhz_set << 5));
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function 'rtw_ioctl_set_macaddr_acl_pvt':
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:3983:2: error: implicit declaration of function 'rtw_set_macaddr_acl' [-Werror=implicit-function-declaration]
rtw_set_macaddr_acl(padapter, param->u.mlme.command);
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function 'rtw_ioctl_acl_add_sta_pvt':
>> drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:4026:8: error: implicit declaration of function 'rtw_acl_add_sta' [-Werror=implicit-function-declaration]
ret = rtw_acl_add_sta(padapter, param->sta_addr);
^
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function 'rtw_ioctl_acl_remove_sta_pvt':

vim +/rtw_sta_flush +3101 drivers/staging/rtl8188eu/os_dep/ioctl_linux.c

3089
3090 static int rtw_hostapd_sta_flush_pvt(struct net_device *dev,
3091 struct iw_request_info *info,
3092 union iwreq_data *wrqu,
3093 char *extra)
3094 {
3095 struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
3096
3097 DBG_88E("%s\n", __func__);
3098
3099 flush_all_cam_entry(padapter); // Clear CAM.
3100
> 3101 return rtw_sta_flush(padapter);
3102 }
3103
3104 static int rtw_add_sta_pvt(struct net_device *dev,
3105 struct iw_request_info *info,
3106 union iwreq_data *wrqu,
3107 char *extra)
3108 {
3109 int ret = 0;
3110 struct sta_info *psta = NULL;
3111 struct ieee_param *param = NULL;
3112 struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
3113 struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
3114 struct sta_priv *pstapriv = &padapter->stapriv;
3115
3116 param = (struct ieee_param *)rtw_malloc(wrqu->data.length);
3117
3118 if (!param) {
3119 DBG_88E(" rtw_add_sta: ieee_param allocate fail !!!\n");
3120
3121 return -ENOMEM;
3122 }
3123
3124 ret = get_private_handler_ieee_param(padapter, wrqu, param);
3125
3126 if (ret != 0) {
3127 kfree(param);
3128 DBG_88E(" rtw_add_sta: ieee_param get fail !!!\n");
3129
3130 return ret;
3131 }
3132
3133 DBG_88E("rtw_add_sta(aid =%d) =%pM\n", param->u.add_sta.aid, (param->sta_addr));
3134
3135 if (!check_fwstate(pmlmepriv, (_FW_LINKED|WIFI_AP_STATE)))
3136 return -EINVAL;
3137
3138 if (param->sta_addr[0] == 0xff && param->sta_addr[1] == 0xff &&
3139 param->sta_addr[2] == 0xff && param->sta_addr[3] == 0xff &&
3140 param->sta_addr[4] == 0xff && param->sta_addr[5] == 0xff)
3141 return -EINVAL;
3142
3143 psta = rtw_get_stainfo(pstapriv, param->sta_addr);
3144 if (psta) {
> 3145 int flags = param->u.add_sta.flags;
3146 psta->aid = param->u.add_sta.aid; // aid = 1~2007.
3147
> 3148 memcpy(psta->bssrateset, param->u.add_sta.tx_supp_rates, 16);
3149
3150 // Check WMM cap.
> 3151 if (WLAN_STA_WME&flags)
3152 psta->qos_option = 1;
3153 else
3154 psta->qos_option = 0;
3155
3156 if (pmlmepriv->qospriv.qos_option == 0)
3157 psta->qos_option = 0;
3158
3159 // Check 802.11n HT cap.
> 3160 if (WLAN_STA_HT&flags) {
3161 psta->htpriv.ht_option = true;
3162 psta->qos_option = 1;
3163 memcpy(&psta->htpriv.ht_cap,
> 3164 &param->u.add_sta.ht_cap,
3165 sizeof(struct ieee80211_ht_cap));
3166 } else {
3167 psta->htpriv.ht_option = false;
3168 }
3169
3170 if (pmlmepriv->htpriv.ht_option == false)
3171 psta->htpriv.ht_option = false;
3172
> 3173 update_sta_info_apmode(padapter, psta);
3174 } else {
3175 ret = -ENOMEM;
3176 }
3177
3178 if (ret == 0 && (copy_to_user(wrqu->data.pointer, param, wrqu->data.length)))
3179 ret = -EFAULT;
3180
3181 return ret;
3182 }
3183
3184 static int rtw_del_sta_pvt(struct net_device *dev,
3185 struct iw_request_info *info,
3186 union iwreq_data *wrqu,
3187 char *extra)
3188 {
3189 int ret = 0;
3190 struct sta_info *psta = NULL;
3191 struct ieee_param *param = NULL;
3192 struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
3193 struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
3194 struct sta_priv *pstapriv = &padapter->stapriv;
3195 int updated = 0;
3196
3197 param = (struct ieee_param *)rtw_malloc(wrqu->data.length);
3198
3199 if (!param) {
3200 DBG_88E(" rtw_del_sta: ieee_param allocate fail !!!\n");
3201
3202 return -ENOMEM;
3203 }
3204
3205 ret = get_private_handler_ieee_param(padapter, wrqu, param);
3206
3207 if (ret != 0) {
3208 kfree(param);
3209 DBG_88E(" rtw_del_sta: ieee_param get fail !!!\n");
3210
3211 return ret;
3212 }
3213
3214 DBG_88E("rtw_del_sta =%pM\n", (param->sta_addr));
3215
3216 if (check_fwstate(pmlmepriv, (_FW_LINKED|WIFI_AP_STATE)) != true)
3217 return -EINVAL;
3218
3219 if (param->sta_addr[0] == 0xff && param->sta_addr[1] == 0xff &&
3220 param->sta_addr[2] == 0xff && param->sta_addr[3] == 0xff &&
3221 param->sta_addr[4] == 0xff && param->sta_addr[5] == 0xff)
3222 return -EINVAL;
3223
3224 psta = rtw_get_stainfo(pstapriv, param->sta_addr);
3225 if (psta) {
3226 spin_lock_bh(&pstapriv->asoc_list_lock);
3227 if (!list_empty(&psta->asoc_list)) {
3228 list_del_init(&psta->asoc_list);
> 3229 pstapriv->asoc_list_cnt--;
> 3230 updated = ap_free_sta(padapter, psta, true, WLAN_REASON_DEAUTH_LEAVING);
3231 }
3232 spin_unlock_bh(&pstapriv->asoc_list_lock);
3233 associated_clients_update(padapter, updated);
3234 psta = NULL;
3235 } else {
3236 DBG_88E("rtw_del_sta(), sta has already been removed or never been added\n");
3237 }
3238
3239 if (ret == 0 && (copy_to_user(wrqu->data.pointer, param, wrqu->data.length)))
3240 ret = -EFAULT;
3241
3242 return ret;
3243 }
3244
3245 static int rtw_set_beacon_pvt(struct net_device *dev,
3246 struct iw_request_info *info,
3247 union iwreq_data *wrqu,
3248 char *extra)
3249 {
3250 int ret = 0;
3251 int len = 0;
3252 unsigned char *pbuf = NULL;
3253 struct ieee_param *param = NULL;
3254 struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
3255 struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
3256 struct sta_priv *pstapriv = &padapter->stapriv;
3257
3258 param = (struct ieee_param *)rtw_malloc(wrqu->data.length);
3259
3260 if (!param) {
3261 DBG_88E(" rtw_set_beacon: ieee_param allocate fail !!!\n");
3262
3263 return -ENOMEM;
3264 }
3265
3266 ret = get_private_handler_ieee_param(padapter, wrqu, param);
3267
3268 if (ret != 0) {
3269 kfree(param);
3270 DBG_88E(" rtw_set_beacon: ieee_param get fail !!!\n");
3271
3272 return ret;
3273 }
3274
3275 len = wrqu->data.length;
> 3276 pbuf = param->u.bcn_ie.buf;
3277
3278 DBG_88E("%s, len =%d\n", __func__, len);
3279
3280 if (check_fwstate(pmlmepriv, WIFI_AP_STATE) != true)
3281 return -EINVAL;
3282
3283 memcpy(&pstapriv->max_num_sta, param->u.bcn_ie.reserved, 2);
3284
> 3285 if ((pstapriv->max_num_sta > NUM_STA) || (pstapriv->max_num_sta <= 0))
> 3286 pstapriv->max_num_sta = NUM_STA;
3287
> 3288 if (rtw_check_beacon_data(padapter, pbuf, (len-12-2)) == _SUCCESS) // 12 = Param header, 2 = Not packed.
3289 ret = 0;
3290 else
3291 ret = -EINVAL;
3292
3293 if (ret == 0 && (copy_to_user(wrqu->data.pointer, param, wrqu->data.length)))
3294 ret = -EFAULT;
3295
3296 return ret;
3297 }
3298

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

Attachment: .config.gz
Description: application/gzip