hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/drivers/net/wireless/ath/ath6kl/wmi.c
....@@ -776,10 +776,8 @@
776776 cmd->info.params.roam_rssi_floor = DEF_LRSSI_ROAM_FLOOR;
777777 cmd->roam_ctrl = WMI_SET_LRSSI_SCAN_PARAMS;
778778
779
- ath6kl_wmi_cmd_send(wmi, 0, skb, WMI_SET_ROAM_CTRL_CMDID,
779
+ return ath6kl_wmi_cmd_send(wmi, 0, skb, WMI_SET_ROAM_CTRL_CMDID,
780780 NO_SYNC_WMIFLAG);
781
-
782
- return 0;
783781 }
784782
785783 int ath6kl_wmi_force_roam_cmd(struct wmi *wmi, const u8 *bssid)
....@@ -1203,8 +1201,7 @@
12031201 static int ath6kl_wmi_bitrate_reply_rx(struct wmi *wmi, u8 *datap, int len)
12041202 {
12051203 struct wmi_bit_rate_reply *reply;
1206
- s32 rate;
1207
- u32 sgi, index;
1204
+ u32 index;
12081205
12091206 if (len < sizeof(struct wmi_bit_rate_reply))
12101207 return -EINVAL;
....@@ -1213,15 +1210,10 @@
12131210
12141211 ath6kl_dbg(ATH6KL_DBG_WMI, "rateindex %d\n", reply->rate_index);
12151212
1216
- if (reply->rate_index == (s8) RATE_AUTO) {
1217
- rate = RATE_AUTO;
1218
- } else {
1213
+ if (reply->rate_index != (s8) RATE_AUTO) {
12191214 index = reply->rate_index & 0x7f;
12201215 if (WARN_ON_ONCE(index > (RATE_MCS_7_40 + 1)))
12211216 return -EINVAL;
1222
-
1223
- sgi = (reply->rate_index & 0x80) ? 1 : 0;
1224
- rate = wmi_rate_tbl[index][sgi];
12251217 }
12261218
12271219 ath6kl_wakeup_event(wmi->parent_dev);
....@@ -1301,8 +1293,7 @@
13011293 if (len < sizeof(*ev))
13021294 return -EINVAL;
13031295 ev = (struct wmi_neighbor_report_event *) datap;
1304
- if (sizeof(*ev) + ev->num_neighbors * sizeof(struct wmi_neighbor_info)
1305
- > len) {
1296
+ if (struct_size(ev, neighbor, ev->num_neighbors) > len) {
13061297 ath6kl_dbg(ATH6KL_DBG_WMI,
13071298 "truncated neighbor event (num=%d len=%d)\n",
13081299 ev->num_neighbors, len);
....@@ -1857,9 +1848,9 @@
18571848 enum network_type nw_type,
18581849 enum dot11_auth_mode dot11_auth_mode,
18591850 enum auth_mode auth_mode,
1860
- enum crypto_type pairwise_crypto,
1851
+ enum ath6kl_crypto_type pairwise_crypto,
18611852 u8 pairwise_crypto_len,
1862
- enum crypto_type group_crypto,
1853
+ enum ath6kl_crypto_type group_crypto,
18631854 u8 group_crypto_len, int ssid_len, u8 *ssid,
18641855 u8 *bssid, u16 channel, u32 ctrl_flags,
18651856 u8 nw_subtype)
....@@ -2309,7 +2300,7 @@
23092300 }
23102301
23112302 int ath6kl_wmi_addkey_cmd(struct wmi *wmi, u8 if_idx, u8 key_index,
2312
- enum crypto_type key_type,
2303
+ enum ath6kl_crypto_type key_type,
23132304 u8 key_usage, u8 key_len,
23142305 u8 *key_rsc, unsigned int key_rsc_len,
23152306 u8 *key_material,
....@@ -3660,7 +3651,7 @@
36603651 if (wait)
36613652 return -EINVAL; /* Offload for wait not supported */
36623653
3663
- buf = kmalloc(data_len, GFP_KERNEL);
3654
+ buf = kmemdup(data, data_len, GFP_KERNEL);
36643655 if (!buf)
36653656 return -ENOMEM;
36663657
....@@ -3671,7 +3662,6 @@
36713662 }
36723663
36733664 kfree(wmi->last_mgmt_tx_frame);
3674
- memcpy(buf, data, data_len);
36753665 wmi->last_mgmt_tx_frame = buf;
36763666 wmi->last_mgmt_tx_frame_len = data_len;
36773667
....@@ -3699,7 +3689,7 @@
36993689 if (wait)
37003690 return -EINVAL; /* Offload for wait not supported */
37013691
3702
- buf = kmalloc(data_len, GFP_KERNEL);
3692
+ buf = kmemdup(data, data_len, GFP_KERNEL);
37033693 if (!buf)
37043694 return -ENOMEM;
37053695
....@@ -3710,7 +3700,6 @@
37103700 }
37113701
37123702 kfree(wmi->last_mgmt_tx_frame);
3713
- memcpy(buf, data, data_len);
37143703 wmi->last_mgmt_tx_frame = buf;
37153704 wmi->last_mgmt_tx_frame_len = data_len;
37163705