From: sashiko-bot@kernel.org
To: "Praneeth Balasubramanian" <praneethb2002@gmail.com>
Cc: linux-usb@vger.kernel.org
Subject: Re: [PATCH net] net: usb: qmi_wwan: unlink mux devices outside the RCU read-side section
Date: Sat, 05 Dec 2026 22:24:42 +0000 [thread overview]
Message-ID: <sashiko-outbox-251960@kernel.org> (raw)
In-Reply-To: <20261204222419.1869694-1-praneethb2002@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] net: usb: qmi_wwan: qmi_wwan_disconnect() traverses
core-internal unreg_list
--
commit e9d2de058dd74fbc5a61bbf397e136f8a3d1961c
Author: Praneeth Balasubramanian <praneethb2002@gmail.com>
net: usb: qmi_wwan: unlink mux devices outside the RCU read-side section
This commit defers unlinking QMAP mux upper devices in qmi_wwan_disconnect()
until after rcu_read_unlock(), queuing them during the RCU walk and unlinking
them before calling unregister_netdevice_many().
> diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
> index e9873dc1d531e..3ca908885c9a1 100644
> --- a/drivers/net/usb/qmi_wwan.c
> +++ b/drivers/net/usb/qmi_wwan.c
[ ... ]
> @@ -1598,10 +1602,13 @@ static void qmi_wwan_disconnect(struct usb_interface *intf)
> restart_syscall();
> return;
> }
> + /* Unlinking can sleep, so only collect the devices under RCU */
> rcu_read_lock();
> netdev_for_each_upper_dev_rcu(dev->net, ldev, iter)
> - qmimux_unregister_device(ldev, &list);
> + unregister_netdevice_queue(ldev, &list);
> rcu_read_unlock();
> + list_for_each_entry(ldev, &list, unreg_list)
> + qmimux_unlink_device(ldev);
[Severity: Low]
Should qmi_wwan_disconnect() iterate struct net_device::unreg_list directly?
unreg_list is private to net/core/dev.c for unregister_netdevice_queue() and
unregister_netdevice_many(), and no other driver accesses it directly.
Reaching into it couples qmi_wwan to evolving core unregistration internals.
Collecting the mux devices on a list_head in struct qmimux_priv would avoid
depending on unreg_list.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204222419.1869694-1-praneethb2002@gmail.com?part=1
prev parent reply other threads:[~2026-12-05 22:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-04 22:24 [PATCH net] net: usb: qmi_wwan: unlink mux devices outside the RCU read-side section Praneeth Balasubramanian
2026-12-05 22:24 ` sashiko-bot [this message]
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=sashiko-outbox-251960@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=praneethb2002@gmail.com \
--cc=sashiko-reviews@lists.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