netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cxgb4: unnecessary check for 0 in the free_sge_txq_uld() function
@ 2024-03-13 15:34 Mikhail Lobanov
  2024-03-15 14:00 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Mikhail Lobanov @ 2024-03-13 15:34 UTC (permalink / raw)
  To: Raju Rangoju
  Cc: Mikhail Lobanov, David S. Miller, Eric Dumazet,
	open list:CXGB4 ETHERNET DRIVER (CXGB4), open list

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>
---
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c
index 17faac715882..5c13bcb4550d 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c
@@ -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);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] cxgb4: unnecessary check for 0 in the free_sge_txq_uld() function
  2024-03-13 15:34 [PATCH] cxgb4: unnecessary check for 0 in the free_sge_txq_uld() function Mikhail Lobanov
@ 2024-03-15 14:00 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-03-15 14:00 UTC (permalink / raw)
  To: Mikhail Lobanov; +Cc: rajur, davem, edumazet, netdev, linux-kernel

Hello:

This patch was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:

On Wed, 13 Mar 2024 11:34:36 -0400 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - cxgb4: unnecessary check for 0 in the free_sge_txq_uld() function
    https://git.kernel.org/netdev/net-next/c/237bb5f7f7f5

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-03-15 14:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-13 15:34 [PATCH] cxgb4: unnecessary check for 0 in the free_sge_txq_uld() function Mikhail Lobanov
2024-03-15 14:00 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).