diff options
| author | Takashi Iwai <tiwai@suse.de> | 2025-11-26 11:08:31 +0100 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-02-06 16:48:28 +0100 |
| commit | daf8a4eb70ff406c0afdcd18adff376923fd14b7 (patch) | |
| tree | 320d368145938187383a3ee1b3630b1ca36e2cff /sound | |
| parent | db24153fc77a82a7eb48322af792c2d41c58f5e9 (diff) | |
ALSA: usb-audio: Fix missing unlock at error path of maxpacksize check
commit fdf0dc82eb60091772ecea73cbc5a8fb7562fc45 upstream.
The recent backport of the upstream commit 05a1fc5efdd8 ("ALSA:
usb-audio: Fix potential overflow of PCM transfer buffer") on the
older stable kernels like 6.12.y was broken since it doesn't consider
the mutex unlock, where the upstream code manages with guard().
In the older code, we still need an explicit unlock.
This is a fix that corrects the error path, applied only on old stable
trees.
Reported-by: Pavel Machek <pavel@denx.de>
Closes: https://lore.kernel.org/aSWtH0AZH5+aeb+a@duo.ucw.cz
Fixes: 98e9d5e33bda ("ALSA: usb-audio: Fix potential overflow of PCM transfer buffer")
Reviewed-by: Pavel Machek <pavel@denx.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound')
| -rw-r--r-- | sound/usb/endpoint.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c index b05ad2eb623d..17ae74b067c5 100644 --- a/sound/usb/endpoint.c +++ b/sound/usb/endpoint.c @@ -1386,7 +1386,8 @@ int snd_usb_endpoint_set_params(struct snd_usb_audio *chip, if (ep->packsize[1] > ep->maxpacksize) { usb_audio_dbg(chip, "Too small maxpacksize %u for rate %u / pps %u\n", ep->maxpacksize, ep->cur_rate, ep->pps); - return -EINVAL; + err = -EINVAL; + goto unlock; } /* calculate the frequency in 16.16 format */ |
