From: Jakub Kicinski <kuba@kernel.org>
To: haokexin@gmail.com
Cc: Jakub Kicinski <kuba@kernel.org>,
horms@kernel.org, edumazet@google.com, davem@davemloft.net,
netdev@vger.kernel.org, vadim.fedorenko@linux.dev,
elfring@users.sourceforge.net, byungchul@sk.com,
andrew+netdev@lunn.ch, h-mittal1@ti.com, danishanwar@ti.com,
pabeni@redhat.com, m-malladi@ti.com, jacob.e.keller@intel.com,
rogerq@kernel.org
Subject: Re: [net-next,1/2] net: ti: icssg-prueth-sr1: Remove unused workqueue
Date: Wed, 4 Feb 2026 20:17:02 -0800 [thread overview]
Message-ID: <20260205041702.2354424-1-kuba@kernel.org> (raw)
In-Reply-To: <20260204-icssg-prueth-workqueue-v1-1-9a892f4b293d@gmail.com>
This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.
For local reproduction steps see https://netdev-ai.bots.linux.dev/ai-local.html
---
net: ti: icssg-prueth-sr1: Remove unused workqueue
This commit removes the dedicated workqueue emac->cmd_wq from
icssg_prueth_sr1.c since it is not utilized in this driver.
> diff --git a/drivers/net/ethernet/ti/icssg/icssg_prueth_sr1.c b/drivers/net/ethernet/ti/icssg/icssg_prueth_sr1.c
> --- a/drivers/net/ethernet/ti/icssg/icssg_prueth_sr1.c
> +++ b/drivers/net/ethernet/ti/icssg/icssg_prueth_sr1.c
> @@ -783,11 +783,6 @@ static int prueth_netdev_init(struct prueth *prueth,
> emac->prueth = prueth;
> emac->ndev = ndev;
> emac->port_id = port;
> - emac->cmd_wq = create_singlethread_workqueue("icssg_cmd_wq");
> - if (!emac->cmd_wq) {
> - ret = -ENOMEM;
> - goto free_ndev;
> - }
[ ... ]
> @@ -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?
--
pw-bot: cr
next prev parent reply other threads:[~2026-02-05 4:17 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-04 2:41 [PATCH net-next 0/2] net: ti: icssg: Remove dedicated workqueue for ndo_set_rx_mode callback Kevin Hao
2026-02-04 2:41 ` [PATCH net-next 1/2] net: ti: icssg-prueth-sr1: Remove unused workqueue Kevin Hao
2026-02-04 10:38 ` Markus Elfring
2026-02-04 12:08 ` Kevin Hao
2026-02-05 4:17 ` Jakub Kicinski [this message]
2026-02-05 4:19 ` [net-next,1/2] " Jakub Kicinski
2026-02-05 5:49 ` Kevin Hao
2026-02-04 2:41 ` [PATCH net-next 2/2] net: ti: icssg-prueth: Use system default workqueue in ndo_set_rx_mode callback Kevin Hao
2026-02-04 10:45 ` Markus Elfring
2026-02-04 12:10 ` Kevin Hao
2026-02-04 11:14 ` [EXTERNAL] [PATCH net-next 0/2] net: ti: icssg: Remove dedicated workqueue for " Meghana Malladi
2026-02-04 12:12 ` Kevin Hao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260205041702.2354424-1-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=byungchul@sk.com \
--cc=danishanwar@ti.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=elfring@users.sourceforge.net \
--cc=h-mittal1@ti.com \
--cc=haokexin@gmail.com \
--cc=horms@kernel.org \
--cc=jacob.e.keller@intel.com \
--cc=m-malladi@ti.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rogerq@kernel.org \
--cc=vadim.fedorenko@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox