Linux Sound subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Hanxiang Xu" <xuhx@hust.edu.cn>
Cc: linux-sound@vger.kernel.org
Subject: Re: [PATCH] ALSA: control: fix find_id()/find_numid() kerneldoc and lock the usb-mixer dedup loop
Date: Wed, 02 Dec 2026 03:15:32 +0000	[thread overview]
Message-ID: <sashiko-outbox-244746@kernel.org> (raw)
In-Reply-To: <20261202103400.5-1-xuhx@hust.edu.cn>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] ALSA: control: missing Fixes: trailer for commit 38ea4c3dc306
--

commit 212246520f3c27e817a4720afbc87e9cb78c2c9f
Author: Hanxiang Xu <xuhx@hust.edu.cn>

> ALSA: control: fix find_id()/find_numid() kerneldoc and lock the usb-mixer dedup loop
>
> With CONFIG_SND_CTL_FAST_LOOKUP the fast paths of
> snd_ctl_find_id()/snd_ctl_find_numid() are unlocked xa_load() calls
> that return an unreferenced struct snd_kcontrol pointer, but their
> kerneldoc still states "Note that this function takes
> card->controls_rwlock lock internally".  Since the removal path frees
> the control without a grace period, a caller that relies on that
> stale statement dereferences freed memory.
>
> The jack-creation (get_available_index()) and vmaster-follower
> (snd_ctl_add_followers()) callers already hold the lock as of
> 7.4-rc5.  Fix the two kerneldoc blocks and lock the remaining
> unlocked caller, the dedup loop of snd_usb_mixer_add_list() (the
> read lock is released before snd_ctl_add() takes the write lock).
>
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Hanxiang Xu <xuhx@hust.edu.cn>

[Severity: Low]
Commit 38ea4c3dc306 ("ALSA: control: Optimize locking for look-up") dropped
internal card->controls_rwsem locking from snd_ctl_find_id() and
snd_ctl_find_numid() and updated their kerneldoc comments to mention
card->controls_rwlock.  Should this include:

  Fixes: 38ea4c3dc306 ("ALSA: control: Optimize locking for look-up")

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261202103400.5-1-xuhx@hust.edu.cn?part=1

      reply	other threads:[~2026-12-02  3:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02  2:34 [PATCH] ALSA: control: fix find_id()/find_numid() kerneldoc and lock the usb-mixer dedup loop Hanxiang Xu
2026-12-02  3:15 ` 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-244746@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=xuhx@hust.edu.cn \
    /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