From: sashiko-bot@kernel.org
To: "Nicholas Velten" <nicholasfvelten@gmail.com>
Cc: linux-usb@vger.kernel.org
Subject: Re: [PATCH] usb: gadget: u_ether: refuse to re-register a failed net_device
Date: Wed, 14 Oct 2026 11:23:23 +0000 [thread overview]
Message-ID: <sashiko-outbox-171196@kernel.org> (raw)
In-Reply-To: <20261014-fix-gadget-netdev-reregister-v1-1-0fb91999da06@gmail.com>
> From: Nicholas Velten <nicholasfvelten@gmail.com>
>
> When register_netdevice() fails in or after netdev_register_kobject(),
> it returns an error but leaves the net_device in NETREG_UNREGISTERED.
> Such a device can never be registered again; the only valid thing to do
> with it is free_netdev().
>
> The configfs Ethernet functions (ECM, EEM, NCM, RNDIS and subset)
> allocate their net_device once per function instance and register it
> from the bind callback, retrying on every bind for as long as the device
> is not registered (formerly tracked by a "bound" flag, now by
> device_is_registered()). After a failed registration the next bind
> therefore calls register_netdev() on an NETREG_UNREGISTERED device and
> hits the BUG_ON() at the top of register_netdevice():
>
> [ ... ]
> Fixes: 40d133d7f542 ("usb: gadget: f_ncm: convert to new function interface with backward compatibility")
> Reported-by: syzbot+85ede281798faf736677@syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=85ede281798faf736677
> Assisted-by: Claude:claude-opus-5-5
> Signed-off-by: Nicholas Velten <nicholasfvelten@gmail.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261014-fix-gadget-netdev-reregister-v1-1-0fb91999da06@gmail.com?part=1
prev parent reply other threads:[~2026-10-14 11:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-14 11:06 [PATCH] usb: gadget: u_ether: refuse to re-register a failed net_device Nicholas Velten via B4 Relay
2026-10-14 11:06 ` Nicholas Velten
2026-10-14 11:23 ` 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-171196@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=nicholasfvelten@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.