Procházet zdrojové kódy

qcacld-3.0: Correct NULL check in ol_tx_bad_peer_update_tx_limit

Fix static analyze issues. add NULL pointer check.

Change-Id: If1380a23a87a50d50458d10f87a512fa87613b27
CRs-Fixed: 2059753
jge před 7 roky
rodič
revize
9bd51dd66b
1 změnil soubory, kde provedl 11 přidání a 1 odebrání
  1. 11 1
      core/dp/txrx/ol_tx_queue.c

+ 11 - 1
core/dp/txrx/ol_tx_queue.c

@@ -807,8 +807,18 @@ ol_tx_bad_peer_update_tx_limit(struct ol_txrx_pdev_t *pdev,
 			       u_int16_t frames,
 			       u_int16_t tx_limit_flag)
 {
+	if (unlikely(NULL == pdev)) {
+		TX_SCHED_DEBUG_PRINT_ALWAYS("Error: NULL pdev handler\n");
+		return;
+	}
+
+	if (unlikely(NULL == txq)) {
+		TX_SCHED_DEBUG_PRINT_ALWAYS("Error: NULL txq\n");
+		return;
+	}
+
 	qdf_spin_lock_bh(&pdev->tx_peer_bal.mutex);
-	if (txq && tx_limit_flag && (txq->peer) &&
+	if (tx_limit_flag && (txq->peer) &&
 	    (txq->peer->tx_limit_flag)) {
 		if (txq->peer->tx_limit < frames)
 			txq->peer->tx_limit = 0;