diff options
author | Ajit Vaishya <ajitv@codeaurora.org> | 2019-03-26 22:45:21 +0530 |
---|---|---|
committer | Sunil Ravi <sunilravi@google.com> | 2019-04-02 21:09:34 +0000 |
commit | e61d13ab7a63db5eb4d4ef58ee60ba9794f38e3a (patch) | |
tree | 134dfb13e513244d4daef74cf03a95f29ea8bc1b /qcwcn/wifi_hal/wifilogger_diag.cpp | |
parent | e526556d3194679797b70fe8ff16e8fccb4cf3f2 (diff) | |
download | wlan-e61d13ab7a63db5eb4d4ef58ee60ba9794f38e3a.tar.gz |
Wifi-Hal: Avoid infinite loop on pkt stats of V0 version
Currently when hardware version received as NULL string,
pkt_log sets to V0 version i.e. PKT_LOG_V0 and parsing of
packet stats done by decrementing specified length mention
in packet log header , in case of PKT_LOG_V0 this length is
decrementing which makes parsing stuck to infinite loop.
To overcome this, parsing length is decremented apart from V2
packet log version too.
CRs-Fixed: 2422931
Bug: 129272032
Bug: 118484168
Test: Connect STA to AP and play youtube.
Change-Id: I573a5158b97f2c2b1b59026a8ae14e23ffc8135f
Diffstat (limited to 'qcwcn/wifi_hal/wifilogger_diag.cpp')
-rw-r--r-- | qcwcn/wifi_hal/wifilogger_diag.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/qcwcn/wifi_hal/wifilogger_diag.cpp b/qcwcn/wifi_hal/wifilogger_diag.cpp index 91545db..0da9a3f 100644 --- a/qcwcn/wifi_hal/wifilogger_diag.cpp +++ b/qcwcn/wifi_hal/wifilogger_diag.cpp @@ -2497,7 +2497,10 @@ static wifi_error parse_stats(hal_info *info, u8 *data, u32 buflen) } } - if (info->pkt_log_ver == PKT_LOG_V1) { + if (info->pkt_log_ver == PKT_LOG_V2) { + data += (sizeof(wh_pktlog_hdr_v2_t) + pkt_stats_header->size); + buflen -= (sizeof(wh_pktlog_hdr_v2_t) + pkt_stats_header->size); + } else { if (pkt_stats_header->flags & PKT_INFO_FLG_PKT_DUMP_V2){ data += (sizeof(wh_pktlog_hdr_v2_t) + pkt_stats_header->size); buflen -= (sizeof(wh_pktlog_hdr_v2_t) + pkt_stats_header->size); @@ -2505,9 +2508,6 @@ static wifi_error parse_stats(hal_info *info, u8 *data, u32 buflen) data += (sizeof(wh_pktlog_hdr_t) + pkt_stats_header->size); buflen -= (sizeof(wh_pktlog_hdr_t) + pkt_stats_header->size); } - } else if (info->pkt_log_ver == PKT_LOG_V2) { - data += (sizeof(wh_pktlog_hdr_v2_t) + pkt_stats_header->size); - buflen -= (sizeof(wh_pktlog_hdr_v2_t) + pkt_stats_header->size); } } while (buflen > 0); |