lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210204212306.GB385551@localhost>
Date:   Thu, 4 Feb 2021 14:23:06 -0700
From:   Nathan Chancellor <nathan@...nel.org>
To:     Arnd Bergmann <arnd@...nel.org>
Cc:     Yisen Zhuang <yisen.zhuang@...wei.com>,
        Salil Mehta <salil.mehta@...wei.com>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        Guangbin Huang <huangguangbin2@...wei.com>,
        Huazhong Tan <tanhuazhong@...wei.com>,
        Arnd Bergmann <arnd@...db.de>, Yufeng Mo <moyufeng@...wei.com>,
        Jian Shen <shenjian15@...wei.com>,
        Yonglong Liu <liuyonglong@...wei.com>, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org, clang-built-linux@...glegroups.com
Subject: Re: [PATCH] net: hns3: avoid -Wpointer-bool-conversion warning

On Thu, Feb 04, 2021 at 04:38:06PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@...db.de>
> 
> clang points out a redundant sanity check:
> 
> drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c:497:28: error: address of array 'filp->f_path.dentry->d_iname' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
> 
> This can never fail, so just remove the check.
> 
> Fixes: 04987ca1b9b6 ("net: hns3: add debugfs support for tm nodes, priority and qset info")
> Signed-off-by: Arnd Bergmann <arnd@...db.de>

Reviewed-by: Nathan Chancellor <nathan@...nel.org>

> ---
>  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
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ