Re: [PATCH 2/2] ALSA: usx2y: Avoid WARN on a repeated DSP load

From: Takashi Iwai

Date: Sat Oct 31 2026 - 12:01:17 EST


On Thu, 29 Oct 2026 09:48:10 +0100,
YuanZhe Liu wrote:
>
> snd_usx2y_hwdep_dsp_load() sets up the asynchronous sequence URBs and
> the interrupt URB when the FPGA firmware image (index 1) is loaded. If
> a later step of the same request fails, for example the creation of the
> ALSA devices, a following DSP load request from user space enters the
> initialization functions for a second time.
>
> usx2y_async_seq04_init() and usx2y_in04_init() assert with WARN_ON()
> that they are called only once, so such a request triggers a kernel
> warning before returning -EBUSY, although nothing is corrupted: the
> functions bail out without allocating again and the leak that the check
> was added for is still prevented.
>
> Return -EBUSY without the warning.
>
> Fixes: 02d382af1c4e ("ALSA: usx2y: Fix potential memory leaks")
> Cc: stable@xxxxxxxxxxxxxxx
> Co-developed-by: Bin Yu <byu@xxxxxxxxxxxxx>
> Signed-off-by: Bin Yu <byu@xxxxxxxxxxxxx>
> Co-developed-by: Cheng Wen <wencheng@xxxxxxxxxxxxx>
> Signed-off-by: Cheng Wen <wencheng@xxxxxxxxxxxxx>
> Signed-off-by: YuanZhe Liu <25031212351@xxxxxxxxxxxxxxxxx>

IMO, it's better to fix the error path in snd_usx2y_hwdep_dsp_load()
instead. The WARN_ON() was meant that it shouldn't happen, and if it
happens, it's something to be fixed, instead.


thanks,

Takashi