Browse Source

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
jitiphil 6 years ago
parent
commit
7c265d301e
1 changed files with 2 additions and 2 deletions
  1. 2 2
      utils/logging/src/wlan_logging_sock_svc.c

+ 2 - 2
utils/logging/src/wlan_logging_sock_svc.c

@@ -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();
 	}