aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2021-02-03 13:10:40 +0000
committerJakub Kicinski <kuba@kernel.org>2021-02-04 18:37:47 -0800
commit8f8a42ff003aaa3c1424923154c9a92f3bd4c634 (patch)
tree28e9ef1034af8450158b85c4c5b4a1ba122f6f5d /drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
parentnfc: pn533: Fix typo issue (diff)
downloadlinux-dev-8f8a42ff003aaa3c1424923154c9a92f3bd4c634.tar.xz
linux-dev-8f8a42ff003aaa3c1424923154c9a92f3bd4c634.zip
net: hns3: remove redundant null check of an array
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 <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>
Diffstat (limited to 'drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c')
-rw-r--r--drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c3
1 files changed, 0 insertions, 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;