[PATCH] cxgb4: Remove redundant NULL check

Subsystems: cxgb4 ethernet driver (cxgb4), networking drivers, the rest

STALE1959d

2 messages, 2 authors, 2021-03-22 · open the first message on its own page

[PATCH] cxgb4: Remove redundant NULL check

From: Jiapeng Chong <hidden>
Date: 2021-03-22 09:54:30

Fix the following coccicheck warnings:

./drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c:3540:2-8: WARNING: NULL
check before some freeing functions is not needed.

Reported-by: Abaci Robot <redacted>
Signed-off-by: Jiapeng Chong <redacted>
---
 drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c b/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c
index 6c85a10..d2ba40c 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c
@@ -3536,8 +3536,7 @@ int cudbg_collect_qdesc(struct cudbg_init *pdbg_init,
 	}
 
 out_free:
-	if (data)
-		kvfree(data);
+	kvfree(data);
 
 #undef QDESC_GET_FLQ
 #undef QDESC_GET_RXQ
-- 
1.8.3.1

Re: [PATCH] cxgb4: Remove redundant NULL check

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-03-22 20:21:10

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Mon, 22 Mar 2021 17:53:14 +0800 you wrote:
Fix the following coccicheck warnings:

./drivers/net/ethernet/chelsio/cxgb4/cudbg_lib.c:3540:2-8: WARNING: NULL
check before some freeing functions is not needed.

Reported-by: Abaci Robot <redacted>
Signed-off-by: Jiapeng Chong <redacted>

[...]
Here is the summary with links:
  - cxgb4: Remove redundant NULL check
    https://git.kernel.org/netdev/net-next/c/c3c3791ce31e

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

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help