[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260204201914.73fec717@kernel.org>
Date: Wed, 4 Feb 2026 20:19:14 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: haokexin@...il.com
Cc: horms@...nel.org, edumazet@...gle.com, davem@...emloft.net,
netdev@...r.kernel.org, vadim.fedorenko@...ux.dev,
elfring@...rs.sourceforge.net, byungchul@...com, andrew+netdev@...n.ch,
h-mittal1@...com, danishanwar@...com, pabeni@...hat.com, m-malladi@...com,
jacob.e.keller@...el.com, rogerq@...nel.org
Subject: Re: [net-next,1/2] net: ti: icssg-prueth-sr1: Remove unused
workqueue
On Wed, 4 Feb 2026 20:17:02 -0800 Jakub Kicinski wrote:
> > @@ -883,8 +878,6 @@
> >
> > free:
> > pruss_release_mem_region(prueth->pruss, &emac->dram);
> > -free_wq:
> > - destroy_workqueue(emac->cmd_wq);
> > free_ndev:
> > emac->ndev = NULL;
> > prueth->emac[mac] = NULL;
>
> Removing the workqueue creation here is fine for the SR1 driver's own error
> path, but doesn't the shared cleanup function prueth_netdev_exit() in
> icssg_common.c still call destroy_workqueue(emac->cmd_wq) unconditionally?
>
> void prueth_netdev_exit(struct prueth *prueth, ...)
> {
> ...
> pruss_release_mem_region(prueth->pruss, &emac->dram);
> destroy_workqueue(emac->cmd_wq);
> free_netdev(emac->ndev);
> ...
> }
>
> Since emac is zero-initialized from alloc_netdev_mqs(), emac->cmd_wq will be
> NULL after this patch. Can this cause a NULL pointer dereference in
> destroy_workqueue() on module unload, since destroy_workqueue() does not
> check for NULL?
Maybe it's not worth separating the removal into two patches if there
are surprising dependencies here? Squash them into one for v2 perhaps?
Powered by blists - more mailing lists