瀏覽代碼

qcacmn: Check for allocation failure in rx ring history

Add allocation check failure before accessing index in
dp_soc_rx_history. In case of allocation failure for a particular ring,
continue with allocation and history recording of other rings.

Change-Id: Ifae46ddf38b3af271900651cdbba662325220ef9
CRs-Fixed: 2747891
Saket Jha 4 年之前
父節點
當前提交
8a35dcfc63
共有 1 個文件被更改,包括 6 次插入3 次删除
  1. 6 3
      dp/wifi3.0/dp_main.c

+ 6 - 3
dp/wifi3.0/dp_main.c

@@ -3856,14 +3856,17 @@ static void dp_soc_rx_history_attach(struct dp_soc *soc)
 
 	for (i = 0; i < MAX_REO_DEST_RINGS; i++) {
 		soc->rx_ring_history[i] = qdf_mem_malloc(rx_ring_hist_size);
-		qdf_atomic_init(&soc->rx_ring_history[i]->index);
+		if (soc->rx_ring_history[i])
+			qdf_atomic_init(&soc->rx_ring_history[i]->index);
 	}
 
 	soc->rx_err_ring_history = qdf_mem_malloc(rx_err_ring_hist_size);
-	qdf_atomic_init(&soc->rx_err_ring_history->index);
+	if (soc->rx_err_ring_history)
+		qdf_atomic_init(&soc->rx_err_ring_history->index);
 
 	soc->rx_reinject_ring_history = qdf_mem_malloc(rx_reinject_hist_size);
-	qdf_atomic_init(&soc->rx_reinject_ring_history->index);
+	if (soc->rx_reinject_ring_history)
+		qdf_atomic_init(&soc->rx_reinject_ring_history->index);
 }
 
 static void dp_soc_rx_history_detach(struct dp_soc *soc)