Skip to content

Commit

Permalink
net: hns3: remove redundant null check of an array
Browse files Browse the repository at this point in the history
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: 04987ca ("net: hns3: add debugfs support for tm nodes, priority and qset info")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Link: https://lore.kernel.org/r/20210203131040.21656-1-colin.king@canonical.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Colin Ian King authored and Jakub Kicinski committed Feb 5, 2021
1 parent d6adfd3 commit 8f8a42f
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8f8a42f

Please sign in to comment.