[PATCH 0/2] ALSA: fix a user-triggerable WARN on repeated DSP load

From: YuanZhe Liu

Date: Thu Oct 29 2026 - 04:48:48 EST


snd_hwdep_dsp_load() checks hw->dsp_loaded and then calls the driver's
dsp_load callback without any serialization. A hwdep file descriptor can
be shared among threads, so two SNDRV_HWDEP_IOCTL_DSP_LOAD requests for
the same index can both pass the check and run the callback concurrently.

The snd-usb-usx2y driver then enters usx2y_async_seq04_init() twice, which
hits WARN_ON(usx2y->as04.buffer) and may also allocate the US-428
sequence URBs twice.

Patch 1 adds a per-device mutex around the check, the callback and the
bookkeeping. Patch 2 removes the WARN_ON() assertions from the usx2y
initialization helpers: a repeated request after a partially failed load
is a valid sequence from user space, so the driver should return -EBUSY
instead of warning.

YuanZhe Liu (2):
ALSA: hwdep: Serialize DSP load requests
ALSA: usx2y: Avoid WARN on a repeated DSP load

include/sound/hwdep.h | 1 +
sound/core/hwdep.c | 2 ++
sound/usb/usx2y/usbusx2y.c | 4 ++--
3 files changed, 5 insertions(+), 2 deletions(-)

--
2.34.1