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: <CAAoacN=Lmh0h_9wQvAe_NRDw_SV22NYA3CN_-uvkOoPs6kQmxg@mail.gmail.com>
Date: Wed, 9 Aug 2023 09:13:31 -0700
From: Jay Vosburgh <j.vosburgh@...il.com>
To: Zhengchao Shao <shaozhengchao@...wei.com>
Cc: netdev@...r.kernel.org, davem@...emloft.net, edumazet@...gle.com, 
	kuba@...nel.org, pabeni@...hat.com, andy@...yhouse.net, 
	weiyongjun1@...wei.com, yuehaibing@...wei.com
Subject: Re: [PATCH net-next 3/5] bonding: remove unnecessary NULL check in
 debugfs function

On 8/9/23, Zhengchao Shao <shaozhengchao@...wei.com> wrote:
> Because debugfs_create_dir returns ERR_PTR, so bonding_debug_root will
> never be NULL. Remove unnecessary NULL check for bonding_debug_root in
> debugfs function.

So after this change it will call debugfs_create_dir(), et al, with
the ERR_PTR value?  Granted, the current behavior is probably not
right, but I don't see how this makes things better.

-J

>
> Signed-off-by: Zhengchao Shao <shaozhengchao@...wei.com>
> ---
>  drivers/net/bonding/bond_debugfs.c | 9 ---------
>  1 file changed, 9 deletions(-)
>
> diff --git a/drivers/net/bonding/bond_debugfs.c
> b/drivers/net/bonding/bond_debugfs.c
> index e4e7f4ee48e0..4c83f89c0a47 100644
> --- a/drivers/net/bonding/bond_debugfs.c
> +++ b/drivers/net/bonding/bond_debugfs.c
> @@ -49,9 +49,6 @@ DEFINE_SHOW_ATTRIBUTE(bond_debug_rlb_hash);
>
>  void bond_debug_register(struct bonding *bond)
>  {
> -	if (!bonding_debug_root)
> -		return;
> -
>  	bond->debug_dir =
>  		debugfs_create_dir(bond->dev->name, bonding_debug_root);
>
> @@ -61,9 +58,6 @@ void bond_debug_register(struct bonding *bond)
>
>  void bond_debug_unregister(struct bonding *bond)
>  {
> -	if (!bonding_debug_root)
> -		return;
> -
>  	debugfs_remove_recursive(bond->debug_dir);
>  }
>
> @@ -71,9 +65,6 @@ void bond_debug_reregister(struct bonding *bond)
>  {
>  	struct dentry *d;
>
> -	if (!bonding_debug_root)
> -		return;
> -
>  	d = debugfs_rename(bonding_debug_root, bond->debug_dir,
>  			   bonding_debug_root, bond->dev->name);
>  	if (!IS_ERR(d)) {
> --
> 2.34.1
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ