]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
cxgb4: unnecessary check for 0 in the free_sge_txq_uld() function
authorMikhail Lobanov <m.lobanov@rosalinux.ru>
Wed, 13 Mar 2024 15:34:36 +0000 (11:34 -0400)
committerDavid S. Miller <davem@davemloft.net>
Fri, 15 Mar 2024 13:57:34 +0000 (13:57 +0000)
The free_sge_txq_old() function has an unnecessary txq check of 0.
This check is not necessary, since the txq pointer is initialized by the
uldtxq[i] address from the operation &txq_info->uldtxq[i], which ensures
that txq is not equal to 0.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: ab677ff4ad15 ("cxgb4: Allocate Tx queues dynamically")
Signed-off-by: Mikhail Lobanov <m.lobanov@rosalinux.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c

index 17faac715882d86ba138ace3e57f41a184592213..5c13bcb4550d37a9b80d2c2fd0b67c8589cc1ca5 100644 (file)
@@ -406,7 +406,7 @@ free_sge_txq_uld(struct adapter *adap, struct sge_uld_txq_info *txq_info)
        for (i = 0; i < nq; i++) {
                struct sge_uld_txq *txq = &txq_info->uldtxq[i];
 
-               if (txq && txq->q.desc) {
+               if (txq->q.desc) {
                        tasklet_kill(&txq->qresume_tsk);
                        t4_ofld_eq_free(adap, adap->mbox, adap->pf, 0,
                                        txq->q.cntxt_id);