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
This commit is contained in:
jge
2017-06-29 10:50:43 +08:00
committed by snandini
parent aa5a80c5d3
commit 9bd51dd66b

View File

@@ -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;