Ver Fonte

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
Yun Park há 8 anos atrás
pai
commit
ff5da56d07
1 ficheiros alterados com 6 adições e 3 exclusões
  1. 6 3
      core/dp/txrx/ol_txrx.c

+ 6 - 3
core/dp/txrx/ol_txrx.c

@@ -5046,14 +5046,17 @@ ol_txrx_fwd_desc_thresh_check(struct ol_txrx_vdev_t *vdev)
 	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;
 }