|
@@ -2437,7 +2437,7 @@ send_peer_chan_width_switch_cmd_tlv(wmi_unified_t wmi_handle,
|
|
|
{
|
|
|
wmi_buf_t buf;
|
|
|
wmi_peer_chan_width_switch_cmd_fixed_param *cmd;
|
|
|
- int32_t len = sizeof(*cmd) + WMI_TLV_HDR_SIZE;
|
|
|
+ int32_t len;
|
|
|
uint32_t max_peers_per_command, max_peers_per_buf;
|
|
|
wmi_chan_width_peer_list *cmd_peer_list;
|
|
|
int16_t pending_peers = param->num_peers;
|
|
@@ -2464,13 +2464,14 @@ send_peer_chan_width_switch_cmd_tlv(wmi_unified_t wmi_handle,
|
|
|
WMI_LOGD("Setting peer limit as %u", max_peers_per_command);
|
|
|
|
|
|
while (pending_peers > 0) {
|
|
|
+ len = sizeof(*cmd) + WMI_TLV_HDR_SIZE;
|
|
|
if (pending_peers >= max_peers_per_command) {
|
|
|
len += (max_peers_per_command * sizeof(*cmd_peer_list));
|
|
|
} else {
|
|
|
len += (pending_peers * sizeof(*cmd_peer_list));
|
|
|
}
|
|
|
|
|
|
- buf = wmi_buf_alloc(wmi_handle, len);
|
|
|
+ buf = wmi_buf_alloc(wmi_handle, len);
|
|
|
if (!buf) {
|
|
|
WMI_LOGE("wmi_buf_alloc failed");
|
|
|
return QDF_STATUS_E_FAILURE;
|