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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <c7176768-1999-4167-b657-3afba97b81b7@gmail.com>
Date: Mon, 14 Oct 2024 00:09:00 +0200
From: Heiner Kallweit <hkallweit1@...il.com>
To: Rosen Penev <rosenp@...il.com>, netdev@...r.kernel.org
Cc: Rafał Miłecki <rafal@...ecki.pl>,
 Broadcom internal kernel review list
 <bcm-kernel-feedback-list@...adcom.com>,
 "David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
 Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
 open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCHv2 net-next] net: bgmac: use devm for register_netdev

On 13.10.2024 23:34, Rosen Penev wrote:
> Removes need to unregister in _remove.
> 
> Tested on ASUS RT-N16. No change in behavior.
> 
This patch changes the order of calls. unregister_netdev() is now called
only after remove(). Shouldn't there be some words about why this is safe
and doesn't e.g. possibly result in race windows?

> Reviewed-by: Florian Fainelli <florian.fainelli@...adcom.com>
> Tested-by: Florian Fainelli <florian.fainelli@...adcom.com>
> Signed-off-by: Rosen Penev <rosenp@...il.com>
> ---
>  v2: added reviewed/tested-by broadcom.
>  drivers/net/ethernet/broadcom/bgmac.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c
> index 6ffdc4229407..2599ffe46e27 100644
> --- a/drivers/net/ethernet/broadcom/bgmac.c
> +++ b/drivers/net/ethernet/broadcom/bgmac.c
> @@ -1546,7 +1546,7 @@ int bgmac_enet_probe(struct bgmac *bgmac)
>  
>  	bgmac->in_init = false;
>  
> -	err = register_netdev(bgmac->net_dev);
> +	err = devm_register_netdev(bgmac->dev, bgmac->net_dev);
>  	if (err) {
>  		dev_err(bgmac->dev, "Cannot register net device\n");
>  		goto err_phy_disconnect;
> @@ -1568,7 +1568,6 @@ EXPORT_SYMBOL_GPL(bgmac_enet_probe);
>  
>  void bgmac_enet_remove(struct bgmac *bgmac)
>  {
> -	unregister_netdev(bgmac->net_dev);
>  	phy_disconnect(bgmac->net_dev->phydev);
>  	netif_napi_del(&bgmac->napi);
>  	bgmac_dma_free(bgmac);


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ