qcacld-3.0: Return false when vdev and pool is NULL in fwd_thresh_check
vdev and pool could be NULL during processing the forwarding packets
processed during the driver deinit.
Add a code to return false if pool is NULL in ol_txrx_fwd_desc_thresh_
check(), then the caller will discard the packet without any further
processing.
Also return false when vdev is NULL.
Change-Id: I45afcbe0e8b953bd1be7b3f1f5315f35879edec5
CRs-Fixed: 1112619
diff --git a/core/dp/txrx/ol_txrx.c b/core/dp/txrx/ol_txrx.c
index 2432396..61df05f 100644
--- a/core/dp/txrx/ol_txrx.c
+++ b/core/dp/txrx/ol_txrx.c
@@ -5046,14 +5046,17 @@
bool enough_desc_flag;
if (!vdev)
- return true;
+ return false;
pool = vdev->pool;
+ if (!pool)
+ return false;
+
qdf_spin_lock_bh(&pool->flow_pool_lock);
enough_desc_flag = (pool->avail_desc < (pool->stop_th +
- OL_TX_NON_FWD_RESERVE))
- ? false : true;
+ OL_TX_NON_FWD_RESERVE))
+ ? false : true;
qdf_spin_unlock_bh(&pool->flow_pool_lock);
return enough_desc_flag;
}