Linux USB
 help / color / mirror / Atom feed
From: Oliver Neukum <oneukum@suse.com>
To: Ginger <ginger.jzllee@gmail.com>
Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: misc: yurex: fix ordering of usb_deregister_dev() and usb_set_intfdata()
Date: Fri, 29 May 2026 12:31:07 +0200	[thread overview]
Message-ID: <7f78b968-3cb3-4194-b709-28e45946697c@suse.com> (raw)
In-Reply-To: <CAGp+u1ZoHA52vPL5msC29BM5g3xT9c8-A20tAs2LHStnuwMmbQ@mail.gmail.com>

On 29.05.26 08:58, Ginger wrote:

> I think the intuition is that the global exposure (i.e., the
> 'usb_minors') of usb fops should be disabled first, so that the
> subsequent nullification of internal fields can be considered local to
> prevent concurrent accesses.

Hi,

if I understand the logic correctly, the order in yurex_disconnect()
makes sure if yurex_open() and yurex_disconnect() race, yurex_open()
will never see an unregistered device with intfdata != NULL.
That is, precisely because without a lock the race is unavoidable
the newly opening task will be guaranteed to know that it has
lost the race.

	Regards
		Oliver


  reply	other threads:[~2026-05-29 10:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-28  8:27 [PATCH] usb: misc: yurex: fix ordering of usb_deregister_dev() and usb_set_intfdata() Junzhe Li
2026-05-28  9:56 ` Oliver Neukum
2026-05-29  6:58   ` Ginger
2026-05-29 10:31     ` Oliver Neukum [this message]
2026-05-29 13:55       ` Ginger
  -- strict thread matches above, loose matches on Subject: below --
2026-04-28  4:54 Ginger
2026-04-28 11:58 ` Greg KH

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=7f78b968-3cb3-4194-b709-28e45946697c@suse.com \
    --to=oneukum@suse.com \
    --cc=ginger.jzllee@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /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