hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/drivers/net/wireless/ath/ath6kl/debug.c
....@@ -30,7 +30,7 @@
3030 __le32 length;
3131
3232 /* max ATH6KL_FWLOG_PAYLOAD_SIZE bytes */
33
- u8 payload[0];
33
+ u8 payload[];
3434 };
3535
3636 #define ATH6KL_FWLOG_MAX_ENTRIES 20
....@@ -1027,14 +1027,17 @@
10271027 {
10281028 struct ath6kl *ar = file->private_data;
10291029 unsigned long lrssi_roam_threshold;
1030
+ int ret;
10301031
10311032 if (kstrtoul_from_user(user_buf, count, 0, &lrssi_roam_threshold))
10321033 return -EINVAL;
10331034
10341035 ar->lrssi_roam_threshold = lrssi_roam_threshold;
10351036
1036
- ath6kl_wmi_set_roam_lrssi_cmd(ar->wmi, ar->lrssi_roam_threshold);
1037
+ ret = ath6kl_wmi_set_roam_lrssi_cmd(ar->wmi, ar->lrssi_roam_threshold);
10371038
1039
+ if (ret)
1040
+ return ret;
10381041 return count;
10391042 }
10401043
....@@ -1132,8 +1135,7 @@
11321135
11331136 tbl = (const struct wmi_target_roam_tbl *) buf;
11341137 num_entries = le16_to_cpu(tbl->num_entries);
1135
- if (sizeof(*tbl) + num_entries * sizeof(struct wmi_bss_roam_info) >
1136
- len)
1138
+ if (struct_size(tbl, info, num_entries) > len)
11371139 return -EINVAL;
11381140
11391141 if (ar->debug.roam_tbl == NULL ||