[PATCH][next] net: hns3: remove redundant null check of an array

Subsystems: hisilicon network subsystem 3 driver (hns3), hisilicon network subsystem driver, networking drivers, the rest

STALE2007d LANDED

Landed in mainline as 8f8a42ff003a on 2021-02-05.

3 messages, 3 authors, 2021-02-05 · open the first message on its own page

[PATCH][next] net: hns3: remove redundant null check of an array

From: Colin King <hidden>
Date: 2021-02-03 13:11:35

From: Colin Ian King <redacted>

The null check of filp->f_path.dentry->d_iname is redundant because
it is an array of DNAME_INLINE_LEN chars and cannot be a null. Fix
this by removing the null check.

Addresses-Coverity: ("Array compared against 0")
Fixes: 04987ca1b9b6 ("net: hns3: add debugfs support for tm nodes, priority and qset info")
Signed-off-by: Colin Ian King <redacted>
---
 drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c | 3 ---
 1 file changed, 3 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
index 6978304f1ac5..c5958754f939 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
@@ -494,9 +494,6 @@ static ssize_t hns3_dbg_read(struct file *filp, char __user *buffer,
 	ssize_t size = 0;
 	int ret = 0;
 
-	if (!filp->f_path.dentry->d_iname)
-		return -EINVAL;
-
 	read_buf = kzalloc(HNS3_DBG_READ_LEN, GFP_KERNEL);
 	if (!read_buf)
 		return -ENOMEM;
-- 
2.29.2

Re: [PATCH][next] net: hns3: remove redundant null check of an array

From: Jesse Brandeburg <hidden>
Date: 2021-02-03 23:25:31

Colin King wrote:
From: Colin Ian King <redacted>

The null check of filp->f_path.dentry->d_iname is redundant because
it is an array of DNAME_INLINE_LEN chars and cannot be a null. Fix
this by removing the null check.

Addresses-Coverity: ("Array compared against 0")
Fixes: 04987ca1b9b6 ("net: hns3: add debugfs support for tm nodes, priority and qset info")
Signed-off-by: Colin Ian King <redacted>
Reviewed-by: Jesse Brandeburg <redacted>

Re: [PATCH][next] net: hns3: remove redundant null check of an array

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-02-05 03:00:57

Hello:

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

On Wed,  3 Feb 2021 13:10:40 +0000 you wrote:
From: Colin Ian King <redacted>

The null check of filp->f_path.dentry->d_iname is redundant because
it is an array of DNAME_INLINE_LEN chars and cannot be a null. Fix
this by removing the null check.

Addresses-Coverity: ("Array compared against 0")
Fixes: 04987ca1b9b6 ("net: hns3: add debugfs support for tm nodes, priority and qset info")
Signed-off-by: Colin Ian King <redacted>

[...]
Here is the summary with links:
  - [next] net: hns3: remove redundant null check of an array
    https://git.kernel.org/netdev/net-next/c/8f8a42ff003a

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