|
@@ -108,7 +108,7 @@ int mwifiex_process_uap_event(struct mwifiex_private *priv)
|
|
struct mwifiex_adapter *adapter = priv->adapter;
|
|
struct mwifiex_adapter *adapter = priv->adapter;
|
|
int len, i;
|
|
int len, i;
|
|
u32 eventcause = adapter->event_cause;
|
|
u32 eventcause = adapter->event_cause;
|
|
- struct station_info sinfo;
|
|
|
|
|
|
+ struct station_info *sinfo;
|
|
struct mwifiex_assoc_event *event;
|
|
struct mwifiex_assoc_event *event;
|
|
struct mwifiex_sta_node *node;
|
|
struct mwifiex_sta_node *node;
|
|
u8 *deauth_mac;
|
|
u8 *deauth_mac;
|
|
@@ -117,7 +117,10 @@ int mwifiex_process_uap_event(struct mwifiex_private *priv)
|
|
|
|
|
|
switch (eventcause) {
|
|
switch (eventcause) {
|
|
case EVENT_UAP_STA_ASSOC:
|
|
case EVENT_UAP_STA_ASSOC:
|
|
- memset(&sinfo, 0, sizeof(sinfo));
|
|
|
|
|
|
+ sinfo = kzalloc(sizeof(*sinfo), GFP_KERNEL);
|
|
|
|
+ if (!sinfo)
|
|
|
|
+ return -ENOMEM;
|
|
|
|
+
|
|
event = (struct mwifiex_assoc_event *)
|
|
event = (struct mwifiex_assoc_event *)
|
|
(adapter->event_body + MWIFIEX_UAP_EVENT_EXTRA_HEADER);
|
|
(adapter->event_body + MWIFIEX_UAP_EVENT_EXTRA_HEADER);
|
|
if (le16_to_cpu(event->type) == TLV_TYPE_UAP_MGMT_FRAME) {
|
|
if (le16_to_cpu(event->type) == TLV_TYPE_UAP_MGMT_FRAME) {
|
|
@@ -132,28 +135,31 @@ int mwifiex_process_uap_event(struct mwifiex_private *priv)
|
|
len = ETH_ALEN;
|
|
len = ETH_ALEN;
|
|
|
|
|
|
if (len != -1) {
|
|
if (len != -1) {
|
|
- sinfo.assoc_req_ies = &event->data[len];
|
|
|
|
- len = (u8 *)sinfo.assoc_req_ies -
|
|
|
|
|
|
+ sinfo->assoc_req_ies = &event->data[len];
|
|
|
|
+ len = (u8 *)sinfo->assoc_req_ies -
|
|
(u8 *)&event->frame_control;
|
|
(u8 *)&event->frame_control;
|
|
- sinfo.assoc_req_ies_len =
|
|
|
|
|
|
+ sinfo->assoc_req_ies_len =
|
|
le16_to_cpu(event->len) - (u16)len;
|
|
le16_to_cpu(event->len) - (u16)len;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- cfg80211_new_sta(priv->netdev, event->sta_addr, &sinfo,
|
|
|
|
|
|
+ cfg80211_new_sta(priv->netdev, event->sta_addr, sinfo,
|
|
GFP_KERNEL);
|
|
GFP_KERNEL);
|
|
|
|
|
|
node = mwifiex_add_sta_entry(priv, event->sta_addr);
|
|
node = mwifiex_add_sta_entry(priv, event->sta_addr);
|
|
if (!node) {
|
|
if (!node) {
|
|
mwifiex_dbg(adapter, ERROR,
|
|
mwifiex_dbg(adapter, ERROR,
|
|
"could not create station entry!\n");
|
|
"could not create station entry!\n");
|
|
|
|
+ kfree(sinfo);
|
|
return -1;
|
|
return -1;
|
|
}
|
|
}
|
|
|
|
|
|
- if (!priv->ap_11n_enabled)
|
|
|
|
|
|
+ if (!priv->ap_11n_enabled) {
|
|
|
|
+ kfree(sinfo);
|
|
break;
|
|
break;
|
|
|
|
+ }
|
|
|
|
|
|
- mwifiex_set_sta_ht_cap(priv, sinfo.assoc_req_ies,
|
|
|
|
- sinfo.assoc_req_ies_len, node);
|
|
|
|
|
|
+ mwifiex_set_sta_ht_cap(priv, sinfo->assoc_req_ies,
|
|
|
|
+ sinfo->assoc_req_ies_len, node);
|
|
|
|
|
|
for (i = 0; i < MAX_NUM_TID; i++) {
|
|
for (i = 0; i < MAX_NUM_TID; i++) {
|
|
if (node->is_11n_enabled)
|
|
if (node->is_11n_enabled)
|
|
@@ -163,6 +169,7 @@ int mwifiex_process_uap_event(struct mwifiex_private *priv)
|
|
node->ampdu_sta[i] = BA_STREAM_NOT_ALLOWED;
|
|
node->ampdu_sta[i] = BA_STREAM_NOT_ALLOWED;
|
|
}
|
|
}
|
|
memset(node->rx_seq, 0xff, sizeof(node->rx_seq));
|
|
memset(node->rx_seq, 0xff, sizeof(node->rx_seq));
|
|
|
|
+ kfree(sinfo);
|
|
break;
|
|
break;
|
|
case EVENT_UAP_STA_DEAUTH:
|
|
case EVENT_UAP_STA_DEAUTH:
|
|
deauth_mac = adapter->event_body +
|
|
deauth_mac = adapter->event_body +
|