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: <9eb45fe8-a0df-4b5d-88a3-ed61f9e320f1@lunn.ch>
Date: Fri, 24 May 2024 17:54:01 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Xiaolei Wang <xiaolei.wang@...driver.com>
Cc: wei.fang@....com, shenwei.wang@....com, xiaoning.wang@....com,
	davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
	pabeni@...hat.com, imx@...ts.linux.dev, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [net v3 PATCH] net:fec: Add fec_enet_deinit()

On Fri, May 24, 2024 at 01:05:28PM +0800, Xiaolei Wang wrote:
> When fec_probe() fails or fec_drv_remove() needs to release the
> fec queue and remove a NAPI context, therefore add a function
> corresponding to fec_enet_init() and call fec_enet_deinit() which
> does the opposite to release memory and remove a NAPI context.
> 
> Fixes: 59d0f7465644 ("net: fec: init multi queue date structure")
> Signed-off-by: Xiaolei Wang <xiaolei.wang@...driver.com>
> Reviewed-by: Wei Fang <wei.fang@....com>
> ---
> v1 -> v2
>  - Add fec_enet_free_queue() in fec_drv_remove()
> v2 -> v3
>  - Add fec_enet_deinit()
> 
>  drivers/net/ethernet/freescale/fec_main.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
> index a72d8a2eb0b3..881ece735dcf 100644
> --- a/drivers/net/ethernet/freescale/fec_main.c
> +++ b/drivers/net/ethernet/freescale/fec_main.c
> @@ -4130,6 +4130,14 @@ static int fec_enet_init(struct net_device *ndev)
>  	return ret;
>  }
>  
> +static void fec_enet_deinit(struct net_device *ndev)
> +{
> +	struct fec_enet_private *fep = netdev_priv(ndev);
> +
> +	netif_napi_del(&fep->napi);
> +	fec_enet_free_queue(ndev);
> +}

That is much better, and using the correct structure helped you find
other bug....

Reviewed-by: Andrew Lunn <andrew@...n.ch>

    Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ