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] [day] [month] [year] [list]
Message-ID: <ca02c938-5ebf-9431-eea0-e919688ab50a@huawei.com>
Date: Mon, 28 Oct 2024 09:56:24 +0800
From: "Leizhen (ThunderTown)" <thunder.leizhen@...wei.com>
To: Simon Horman <horms@...nel.org>
CC: Rasesh Mody <rmody@...vell.com>, Sudarsana Kalluru <skalluru@...vell.com>,
	<GR-Linux-NIC-Dev@...vell.com>, Andrew Lunn <andrew+netdev@...n.ch>, "David S
 . Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Jakub
 Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	<netdev@...r.kernel.org>
Subject: Re: [PATCH v2 1/2] bna: Remove error checking for debugfs create APIs



On 2024/10/26 23:35, Simon Horman wrote:
> On Sat, Oct 26, 2024 at 11:47:59AM +0800, Zhen Lei wrote:
>> Driver bna can work fine even if any previous call to debugfs create
>> APIs failed. All return value checks of them should be dropped, as
>> debugfs APIs say.
>>
>> Signed-off-by: Zhen Lei <thunder.leizhen@...wei.com>
>> ---
>>  drivers/net/ethernet/brocade/bna/bnad_debugfs.c | 15 +--------------
>>  1 file changed, 1 insertion(+), 14 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/brocade/bna/bnad_debugfs.c b/drivers/net/ethernet/brocade/bna/bnad_debugfs.c
>> index 97291bfbeea589e..220d20a829c8a84 100644
>> --- a/drivers/net/ethernet/brocade/bna/bnad_debugfs.c
>> +++ b/drivers/net/ethernet/brocade/bna/bnad_debugfs.c
>> @@ -500,19 +500,12 @@ bnad_debugfs_init(struct bnad *bnad)
>>  	if (!bna_debugfs_root) {
>>  		bna_debugfs_root = debugfs_create_dir("bna", NULL);
>>  		atomic_set(&bna_debugfs_port_count, 0);
>> -		if (!bna_debugfs_root) {
>> -			netdev_warn(bnad->netdev,
>> -				    "debugfs root dir creation failed\n");
>> -			return;
>> -		}
>>  	}
>>  
>>  	/* Setup the pci_dev debugfs directory for the port */
>>  	snprintf(name, sizeof(name), "pci_dev:%s", pci_name(bnad->pcidev));
>>  	if (!bnad->port_debugfs_root) {
>> -		bnad->port_debugfs_root =
>> -			debugfs_create_dir(name, bna_debugfs_root);
>> -
>> +		bnad->port_debugfs_root = debugfs_create_dir(name, bna_debugfs_root);
> 
> nit: This change seems to only change line wrapping from <= 80 columns wide
>      (still preferred for Networking code) to > 80 columns wide (not so good).
> 
>      Probably this part of the patch should be removed.
>      If not, reworked so it is <= 80 columns wide.

Okay, I'll revert this one.

> 
> Otherwise, this patch looks good to me.

then add: Reviewed-by: Simon Horman <horms@...nel.org>

> 
>>  		atomic_inc(&bna_debugfs_port_count);
>>  
>>  		for (i = 0; i < ARRAY_SIZE(bnad_debugfs_files); i++) {
>> @@ -523,12 +516,6 @@ bnad_debugfs_init(struct bnad *bnad)
>>  							bnad->port_debugfs_root,
>>  							bnad,
>>  							file->fops);
>> -			if (!bnad->bnad_dentry_files[i]) {
>> -				netdev_warn(bnad->netdev,
>> -					    "create %s entry failed\n",
>> -					    file->name);
>> -				return;
>> -			}
>>  		}
>>  	}
>>  }
> 

-- 
Regards,
  Zhen Lei

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ