From: Takashi Iwai <tiwai@suse.de>
To: YuanZhe Liu <25031212351@stu.xidian.edu.cn>
Cc: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
Bin Yu <byu@xidian.edu.cn>, Cheng Wen <wencheng@xidian.edu.cn>,
linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH 2/2] ALSA: usx2y: Avoid WARN on a repeated DSP load
Date: Sat, 31 Oct 2026 17:00:38 +0100 [thread overview]
Message-ID: <871p95svvd.wl-tiwai@suse.de> (raw)
In-Reply-To: <20261029084810.21910-3-25031212351@stu.xidian.edu.cn>
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@vger.kernel.org
> Co-developed-by: Bin Yu <byu@xidian.edu.cn>
> Signed-off-by: Bin Yu <byu@xidian.edu.cn>
> Co-developed-by: Cheng Wen <wencheng@xidian.edu.cn>
> Signed-off-by: Cheng Wen <wencheng@xidian.edu.cn>
> Signed-off-by: YuanZhe Liu <25031212351@stu.xidian.edu.cn>
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
next prev parent reply other threads:[~2026-10-31 16:00 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-29 8:48 [PATCH 0/2] ALSA: fix a user-triggerable WARN on repeated DSP load YuanZhe Liu
2026-10-29 8:48 ` [PATCH 1/2] ALSA: hwdep: Serialize DSP load requests YuanZhe Liu
2026-10-31 16:00 ` Takashi Iwai
2026-10-29 8:48 ` [PATCH 2/2] ALSA: usx2y: Avoid WARN on a repeated DSP load YuanZhe Liu
2026-10-31 16:00 ` Takashi Iwai [this message]
2026-10-31 17:16 ` [PATCH v2] ALSA: usx2y: Release the URBs when the DSP load fails YuanZhe Liu
2026-10-31 17:27 ` sashiko-bot
2026-10-31 18:56 ` [PATCH v3] " YuanZhe Liu
2026-10-31 19:07 ` sashiko-bot
2026-10-31 19:15 ` [PATCH v4] ALSA: usx2y: Refuse a retried DSP load after a failure YuanZhe Liu
2026-10-30 17:36 ` [PATCH 0/2] ALSA: fix a user-triggerable WARN on repeated DSP load YuanZhe Liu
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=871p95svvd.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=25031212351@stu.xidian.edu.cn \
--cc=byu@xidian.edu.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=stable@vger.kernel.org \
--cc=tiwai@suse.com \
--cc=wencheng@xidian.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