Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Jul 2026 22:28:19 +0000
From:      Christos Margiolis <christos@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: c715fbb8b7e4 - stable/15 - snd_uaudio: Initialize mixer_lock with MTX_RECURSE
Message-ID:  <6a5ff283.39485.152c7f6a@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch stable/15 has been updated by christos:

URL: https://cgit.FreeBSD.org/src/commit/?id=c715fbb8b7e4926b93d7949b4d51ab07334d0b84

commit c715fbb8b7e4926b93d7949b4d51ab07334d0b84
Author:     Christos Margiolis <christos@FreeBSD.org>
AuthorDate: 2026-07-11 12:57:35 +0000
Commit:     Christos Margiolis <christos@FreeBSD.org>
CommitDate: 2026-07-21 22:28:12 +0000

    snd_uaudio: Initialize mixer_lock with MTX_RECURSE
    
    Fixes:          fc9dc8482396 ("snd_uaudio: Lock usbd_transfer_start() in uaudio_mixer_ctl_set()")
    PR:             296682
    Sponsored by:   The FreeBSD Foundation
    MFC after:      3 days
    
    (cherry picked from commit 954001a9dd363da9184706657eb34f9622bb220f)
---
 sys/dev/sound/usb/uaudio.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c
index eedd52774b70..2425666f224d 100644
--- a/sys/dev/sound/usb/uaudio.c
+++ b/sys/dev/sound/usb/uaudio.c
@@ -5435,7 +5435,14 @@ uaudio_mixer_init_sub(struct uaudio_softc *sc, struct snd_mixer *m)
 
 	DPRINTF("child=%u\n", i);
 
-	mtx_init(&sc->sc_child[i].mixer_lock, "uaudio mixer lock", NULL, MTX_DEF);
+	/*
+	 * Initialize the mutex with MTX_RECURSE so that functions like
+	 * uaudio_mixer_ctl_set() do not panic when they recurse on the lock,
+	 * as a result of a callback function (e.g., uaudio_hid_rx_callback())
+	 * also having acquired it.
+	 */
+	mtx_init(&sc->sc_child[i].mixer_lock, "uaudio mixer lock", NULL,
+	    MTX_RECURSE);
 	sc->sc_child[i].mixer_dev = m;
 
 	if (i == 0 &&


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a5ff283.39485.152c7f6a>