diff --git a/core/wma/src/wma_utils.c b/core/wma/src/wma_utils.c index 1008fa2d6b97a..2a1f02900260c 100644 --- a/core/wma/src/wma_utils.c +++ b/core/wma/src/wma_utils.c @@ -771,8 +771,8 @@ static tSirLLStatsResults *wma_get_ll_stats_ext_buf(uint32_t *len, excess_data = true; break; } - if (peer_num > (WMI_SVC_MSG_MAX_SIZE - total_peer_len) / - sizeof(struct sir_wifi_ll_ext_peer_stats)) { + if (peer_num > WMI_SVC_MSG_MAX_SIZE / (total_peer_len + + sizeof(struct sir_wifi_ll_ext_peer_stats))) { excess_data = true; break; } else {