All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: linux-sound@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ALSA: core: Make sure to call snd_card_disconnect() at freeing
Date: Thu, 01 Oct 2026 17:06:09 +0200	[thread overview]
Message-ID: <87y0ch1mvy.wl-tiwai@suse.de> (raw)
In-Reply-To: <20261001131810.527650-1-tiwai@suse.de>

On Thu, 01 Oct 2026 15:18:09 +0200,
Takashi Iwai wrote:
> 
> When a card object gets freed via devres, it might be freed without
> calling snd_card_disconnect(), and it might forget to release some
> resources such as the procfs that gets deleted at the disconnect call.
> 
> Add an explicit call of snd_card_disconnect() at snd_card_do_free()
> for assuring the preparation for cleanup.
> 
> Fixes: e8ad415b7a55 ("ALSA: core: Add managed card creation")
> Signed-off-by: Takashi Iwai <tiwai@suse.de>
> ---
> 
> This patch is required as a prerequisite for the recent cleanup series
> to use auto-cleanup:
>   http://lore.kernel.org/20261001110447.486782-1-tiwai@suse.de

Scratch this (and the series above).

It turned out that this can be problematic in another subtle way.
Namely, when snd_card_disconnect() is called from the card_dev's
destructor, it can double-free the card_dev via device_del().
Skipping this call doesn't suffice as dpm_list may be still unbalanced
without the explicit call of device_del() beforehand...

A new fix and another series of cleanups will come up later.


Takashi

      reply	other threads:[~2026-10-01 15:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-01 13:18 [PATCH] ALSA: core: Make sure to call snd_card_disconnect() at freeing Takashi Iwai
2026-10-01 15:06 ` 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=87y0ch1mvy.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@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 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.