.. | .. |
---|
30 | 30 | __le32 length; |
---|
31 | 31 | |
---|
32 | 32 | /* max ATH6KL_FWLOG_PAYLOAD_SIZE bytes */ |
---|
33 | | - u8 payload[0]; |
---|
| 33 | + u8 payload[]; |
---|
34 | 34 | }; |
---|
35 | 35 | |
---|
36 | 36 | #define ATH6KL_FWLOG_MAX_ENTRIES 20 |
---|
.. | .. |
---|
1027 | 1027 | { |
---|
1028 | 1028 | struct ath6kl *ar = file->private_data; |
---|
1029 | 1029 | unsigned long lrssi_roam_threshold; |
---|
| 1030 | + int ret; |
---|
1030 | 1031 | |
---|
1031 | 1032 | if (kstrtoul_from_user(user_buf, count, 0, &lrssi_roam_threshold)) |
---|
1032 | 1033 | return -EINVAL; |
---|
1033 | 1034 | |
---|
1034 | 1035 | ar->lrssi_roam_threshold = lrssi_roam_threshold; |
---|
1035 | 1036 | |
---|
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); |
---|
1037 | 1038 | |
---|
| 1039 | + if (ret) |
---|
| 1040 | + return ret; |
---|
1038 | 1041 | return count; |
---|
1039 | 1042 | } |
---|
1040 | 1043 | |
---|
.. | .. |
---|
1132 | 1135 | |
---|
1133 | 1136 | tbl = (const struct wmi_target_roam_tbl *) buf; |
---|
1134 | 1137 | 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) |
---|
1137 | 1139 | return -EINVAL; |
---|
1138 | 1140 | |
---|
1139 | 1141 | if (ar->debug.roam_tbl == NULL || |
---|