All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Cen Zhang <zzzccc427@gmail.com>
Cc: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
	baijiaju1990@gmail.com
Subject: Re: [PATCH] ALSA: usb-audio: Release components on probe errors
Date: Mon, 29 Jun 2026 12:28:07 +0200	[thread overview]
Message-ID: <871pdpr688.wl-tiwai@suse.de> (raw)
In-Reply-To: <20260618170026.192212-1-zzzccc427@gmail.com>

On Thu, 18 Jun 2026 19:00:26 +0200,
Cen Zhang wrote:
> 
> usb_audio_probe() can create USB-audio component resources before the
> first interface is recorded in chip->num_interfaces.  If a later probe
> step fails, the error path drops chip->active and frees the card directly
> when no interfaces have been registered.
> 
> Normal disconnect first releases USB-audio components in a fixed order
> before the card is freed.  The first-interface probe error path skipped
> that sequence, so partially initialized PCM, endpoint, MIDI, media, or
> mixer resources could be left for the card private_free path without their
> disconnect handling having run.
> 
> Move the existing normal-disconnect component release sequence into a
> helper and call it from the zero-interface probe error path before
> snd_card_free().  Keep the normal disconnect ordering unchanged: PCM
> streams, endpoint resources, MIDI 1.0 resources, MIDI 2.0 resources, media
> device cleanup, then mixer resources.
> 
> Assisted-by: Codex:gpt-5.5
> Signed-off-by: Cen Zhang <zzzccc427@gmail.com>

Applied to for-next branch now.  Thanks.


Takashi

      reply	other threads:[~2026-06-29 10:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-18 17:00 [PATCH] ALSA: usb-audio: Release components on probe errors Cen Zhang
2026-06-29 10:28 ` Takashi Iwai [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=871pdpr688.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=baijiaju1990@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    --cc=zzzccc427@gmail.com \
    /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.