Browse Source

qcacmn: Fix the null check before invoking function

Fix the logic that verifies that the dbs function pointer
in data path is valid.

Change-Id: I35418f2a66eb2d4b44260b005ab0d927d91eeac7
CRs-Fixed: 2025317
Dhanashri Atre 8 years ago
parent
commit
398935eb56
1 changed files with 12 additions and 9 deletions
  1. 12 9
      dp/wifi3.0/dp_main.c

+ 12 - 9
dp/wifi3.0/dp_main.c

@@ -1460,6 +1460,7 @@ static void dp_rxdma_ring_config(struct dp_soc *soc)
 		if (pdev) {
 			int mac_id = 0;
 			int j;
+			bool dbs_enable = 0;
 			int max_mac_rings =
 				 wlan_cfg_get_num_mac_rings
 				(pdev->wlan_cfg_ctx);
@@ -1470,18 +1471,20 @@ static void dp_rxdma_ring_config(struct dp_soc *soc)
 
 			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);
-				}
+				dbs_enable = soc->cdp_soc.ol_ops->
+					is_hw_dbs_2x2_capable();
+			}
+
+			if (dbs_enable) {
+				QDF_TRACE(QDF_MODULE_ID_TXRX,
+				QDF_TRACE_LEVEL_ERROR,
+				FL("DBS enabled max_mac_rings %d\n"),
+					 max_mac_rings);
 			} else {
+				max_mac_rings = 1;
 				QDF_TRACE(QDF_MODULE_ID_TXRX,
 					 QDF_TRACE_LEVEL_ERROR,
-					 FL("DBS enabled max_mac_rings %d\n"),
+					 FL("DBS disabled, max_mac_rings %d\n"),
 					 max_mac_rings);
 			}