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]
Date:   Wed, 6 Jul 2022 10:29:57 +0530
From:   Siddharth Vadapalli <s-vadapalli@...com>
To:     Jakub Kicinski <kuba@...nel.org>
CC:     <davem@...emloft.net>, <linux@...linux.org.uk>,
        <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <kishon@...com>, <vigneshr@...com>, <grygorii.strashko@...com>,
        <s-vadapalli@...com>
Subject: Re: [PATCH net v2] net: ethernet: ti: am65-cpsw: Fix devlink port
 register sequence

Hello Jakub,

On 06/07/22 07:09, Jakub Kicinski wrote:
> On Mon, 4 Jul 2022 13:00:40 +0530 Siddharth Vadapalli wrote:
>> @@ -2527,6 +2527,10 @@ static int am65_cpsw_nuss_register_ndevs(struct am65_cpsw_common *common)
>>  		return ret;
>>  	}
>>  
>> +	ret = am65_cpsw_nuss_register_devlink(common);
>> +	if (ret)
>> +		goto err_cleanup_ndev;
>> +
>>  	for (i = 0; i < common->port_num; i++) {
>>  		port = &common->ports[i];
>>  
>> @@ -2539,23 +2543,21 @@ static int am65_cpsw_nuss_register_ndevs(struct am65_cpsw_common *common)
>>  				i, ret);
>>  			goto err_cleanup_ndev;
>>  		}
>> +
>> +		dl_port = &port->devlink_port;
>> +		devlink_port_type_eth_set(dl_port, port->ndev);
>>  	}
>>  
>>  	ret = am65_cpsw_register_notifiers(common);
>>  	if (ret)
>>  		goto err_cleanup_ndev;
>>  
>> -	ret = am65_cpsw_nuss_register_devlink(common);
>> -	if (ret)
>> -		goto clean_unregister_notifiers;
>> -
>>  	/* can't auto unregister ndev using devm_add_action() due to
>>  	 * devres release sequence in DD core for DMA
>>  	 */
>>  
>>  	return 0;
>> -clean_unregister_notifiers:
>> -	am65_cpsw_unregister_notifiers(common);
>> +
>>  err_cleanup_ndev:
>>  	am65_cpsw_nuss_cleanup_ndev(common);
> 
> No additions to the error handling path? Slightly suspicious.
> Do the devlink ports not have to be removed if netdev registration
> fails?

Thank you for pointing it out. I had missed adding the cleanup for the register
devlink function call. I will add it and post the v3 patch.

Regards,
Siddharth.

Powered by blists - more mailing lists