qcacmn: Packet stat collection failure

Change made I7fd67b02c3b7cb4f1bfe7c6f4641f6d881e25abd
to fix possible NULL dereference of pkt_stats_dump
caused pkt stats collection to fail as pkt_stats_dump
is NULL from cds_pkt_stats_to_logger_thread.

Move NULL check for pkt_stats_dump to just before
it is dereferenced

Change-Id: I0f4c9d58f0d4d17d6c26bfbbd79f6447dd52230b
CRs-Fixed: 2358139
This commit is contained in:
jitiphil
2018-11-27 17:24:23 +05:30
committed by nshrivas
parent 53262f1d1f
commit 7c265d301e

View File

@@ -1252,7 +1252,7 @@ void wlan_pkt_stats_to_logger_thread(void *pl_hdr, void *pkt_dump, void *data)
spin_lock_irqsave(&gwlan_logging.pkt_stats_lock, flags);
if (!gwlan_logging.pkt_stats_pcur_node || (NULL == pkt_stats_dump)) {
if (!gwlan_logging.pkt_stats_pcur_node) {
spin_unlock_irqrestore(&gwlan_logging.pkt_stats_lock, flags);
return;
}
@@ -1285,7 +1285,7 @@ void wlan_pkt_stats_to_logger_thread(void *pl_hdr, void *pkt_dump, void *data)
pktlog_hdr->size),
data, pktlog_hdr->size);
if (pkt_stats_dump->type == STOP_MONITOR) {
if (pkt_stats_dump && pkt_stats_dump->type == STOP_MONITOR) {
wake_up_thread = true;
wlan_get_pkt_stats_free_node();
}