From 398935eb56055f6f815ecf604960b602fc9bedb7 Mon Sep 17 00:00:00 2001 From: Dhanashri Atre Date: Fri, 31 Mar 2017 15:34:28 -0700 Subject: [PATCH] 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 --- dp/wifi3.0/dp_main.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index 67c353ceb1c4..7a68c9233426 100644 --- a/dp/wifi3.0/dp_main.c +++ b/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); }