From: sashiko-bot@kernel.org
To: "Danilo Krummrich" <dakr@kernel.org>
Cc: linux-usb@vger.kernel.org
Subject: Re: [PATCH v2] usb: core: don't set drvdata to NULL in usb_unbind_interface()
Date: Sat, 10 Oct 2026 13:58:14 +0000 [thread overview]
Message-ID: <sashiko-outbox-166634@kernel.org> (raw)
In-Reply-To: <20261010135131.286498-1-dakr@kernel.org>
> usb_unbind_interface() serves as the remove() callback of struct
> usb_driver and calls usb_set_intfdata(intf, NULL) to clear the bus
> device private data pointer.
>
> However, the driver core code already sets the bus device private data
> pointer to NULL in device_unbind_cleanup() *after* devres_release_all(),
> which makes the call redundant.
>
> In addition, it can create unexpected NULL pointer dereference scenarios
> when drivers use managed APIs.
>
> int probe(struct usb_interface *intf,
> const struct usb_device_id *id)
> {
> struct data *data;
> [ ... ]
> Cc: stable@kernel.org
> Fixes: a995fe1a3aa7 ("rust: driver: drop device private data post unbind")
> Reviewed-by: Johan Hovold <johan@kernel.org>
> Acked-by: Alan Stern <stern@rowland.harvard.edu>
> Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261010135131.286498-1-dakr@kernel.org?part=1
prev parent reply other threads:[~2026-10-10 13:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-10 13:50 [PATCH v2] usb: core: don't set drvdata to NULL in usb_unbind_interface() Danilo Krummrich
2026-10-10 13:58 ` 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-166634@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dakr@kernel.org \
--cc=linux-usb@vger.kernel.org \
--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