diff options
author | Subhani Shaik <subhanis@codeaurora.org> | 2015-08-07 17:41:08 +0530 |
---|---|---|
committer | Vineeta Srivastava <vsrivastava@google.com> | 2015-08-10 16:57:20 -0700 |
commit | 271bc72c80d912e05fe8585d8b83df70fe29a616 (patch) | |
tree | d2d1c0e0c6e6572143f6557a762226d6f87e4240 /qcwcn/wifi_hal/wifilogger_diag.cpp | |
parent | 5d2151fc5acf814358412beeaf367ad30e5f8ed4 (diff) | |
download | wlan-271bc72c80d912e05fe8585d8b83df70fe29a616.tar.gz |
WiFi-HAL: Validate debug events with sufficient length only
Frequent updations are expected to the stats structures from
firmware. Validating the events received based on its exact size
may not be correct in this case. So, consider events as valid only
if the size of events is not less than expected.
Rx peer info event has been handled with the help flags already.
So, remove the duplicate check from parse_rx_stats()
Change-Id: I42f2a3f402684fd3de049d7d9fe011068fabb45b
Diffstat (limited to 'qcwcn/wifi_hal/wifilogger_diag.cpp')
-rw-r--r-- | qcwcn/wifi_hal/wifilogger_diag.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/qcwcn/wifi_hal/wifilogger_diag.cpp b/qcwcn/wifi_hal/wifilogger_diag.cpp index d021541..3fe6609 100644 --- a/qcwcn/wifi_hal/wifilogger_diag.cpp +++ b/qcwcn/wifi_hal/wifilogger_diag.cpp @@ -1258,12 +1258,7 @@ static wifi_error parse_rx_stats(hal_info *info, u8 *buf, u16 size) wifi_ring_buffer_entry *pRingBufferEntry; u32 len_ring_buffer_entry = 0; - if (size == EVENT_RX_PEERINFO_SIZE) { - // TODO Parse the event later - return WIFI_SUCCESS; - } - - if (size != sizeof(rb_pkt_stats_t)) { + if (size < sizeof(rb_pkt_stats_t)) { ALOGE("%s Unexpected rx stats event length: %d", __FUNCTION__, size); memset(info->rx_aggr_pkts, 0, info->rx_buf_size_occupied); memset(&info->aggr_stats, 0, sizeof(rx_aggr_stats)); @@ -1503,7 +1498,7 @@ static wifi_error parse_tx_stats(hal_info *info, void *buf, { case PKTLOG_TYPE_TX_CTRL: { - if (buflen != sizeof (wh_pktlog_txctl)) { + if (buflen < sizeof (wh_pktlog_txctl)) { ALOGE("Unexpected tx_ctrl event length: %d", buflen); return WIFI_ERROR_UNKNOWN; } @@ -1530,7 +1525,7 @@ static wifi_error parse_tx_stats(hal_info *info, void *buf, break; case PKTLOG_TYPE_TX_STAT: { - if (buflen != sizeof(struct tx_ppdu_end)) { + if (buflen < sizeof(struct tx_ppdu_end)) { ALOGE("Unexpected tx_stat event length: %d", buflen); return WIFI_ERROR_UNKNOWN; } |