mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-14 16:46:15 -04:00
qcacld-3.0: Fix chain_stats memory illegal access
chain_stats in WMI_UPDATE_STATS_EVENTID_param_tlvs may be set as NULL by wlan firmware. When access chain_stats, make sure it is not NULL. Change-Id: I3a78534899a3a56f378c4825ff5b8abedb543b8c CRs-Fixed: 2102247
This commit is contained in:
parent
036d449d4b
commit
f904765f82
1 changed files with 10 additions and 8 deletions
|
|
@ -2942,14 +2942,16 @@ int wma_stats_event_handler(void *handle, uint8_t *cmd_param_info,
|
|||
|
||||
rssi_event =
|
||||
(wmi_per_chain_rssi_stats *) param_buf->chain_stats;
|
||||
if (rssi_event && (rssi_event->num_per_chain_rssi_stats >
|
||||
((WMI_SVC_MSG_MAX_SIZE - sizeof(*event)) /
|
||||
sizeof(*peer_stats)))) {
|
||||
excess_data = true;
|
||||
break;
|
||||
} else {
|
||||
buf_len += rssi_event->num_per_chain_rssi_stats *
|
||||
sizeof(*peer_stats);
|
||||
if (rssi_event) {
|
||||
if (rssi_event->num_per_chain_rssi_stats >
|
||||
((WMI_SVC_MSG_MAX_SIZE - sizeof(*event)) /
|
||||
sizeof(*rssi_event))) {
|
||||
excess_data = true;
|
||||
break;
|
||||
} else {
|
||||
buf_len += sizeof(*rssi_event) *
|
||||
rssi_event->num_per_chain_rssi_stats;
|
||||
}
|
||||
}
|
||||
} while (0);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue