Parcourir la source

qcacmn: Add null check before invoking function

Verify that the dbs function pointer in data path is valid.

Change-Id: I2add5cf3b58ef52240d9cda01220ba444b7716ad
CRs-Fixed: 2025317
Dhanashri Atre il y a 8 ans
Parent
commit
2c6381da6b
1 fichiers modifiés avec 11 ajouts et 8 suppressions
  1. 11 8
      dp/wifi3.0/dp_main.c

+ 11 - 8
dp/wifi3.0/dp_main.c

@@ -1468,17 +1468,20 @@ static void dp_rxdma_ring_config(struct dp_soc *soc)
 				 pdev->rx_refill_buf_ring.hal_srng,
 				 RXDMA_BUF);
 
-			if (!soc->cdp_soc.ol_ops->
-				is_hw_dbs_2x2_capable()) {
-				max_mac_rings = 1;
-				QDF_TRACE(QDF_MODULE_ID_TXRX,
-					 QDF_TRACE_LEVEL_ERROR,
-					 FL("DBS enabled, max_mac_rings %d\n"),
-					 max_mac_rings);
+			if (soc->cdp_soc.ol_ops->
+				is_hw_dbs_2x2_capable) {
+				if (!soc->cdp_soc.ol_ops->
+					is_hw_dbs_2x2_capable()) {
+					max_mac_rings = 1;
+					QDF_TRACE(QDF_MODULE_ID_TXRX,
+						 QDF_TRACE_LEVEL_ERROR,
+						 FL("DBS disabled, max_mac_rings %d\n"),
+						 max_mac_rings);
+				}
 			} else {
 				QDF_TRACE(QDF_MODULE_ID_TXRX,
 					 QDF_TRACE_LEVEL_ERROR,
-					 FL("DBS disabled max_mac_rings %d\n"),
+					 FL("DBS enabled max_mac_rings %d\n"),
 					 max_mac_rings);
 			}