Skip to content

Commit 9e5074f

Browse files
tiwailanlanxiyiji
authored andcommitted
ALSA: usb-audio: Fix missing unlock at error path of maxpacksize check
stable inclusion from stable-v6.12.60 category: bugfix The recent backport of the upstream commit 05a1fc5 ("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> (cherry picked from commit fdf0dc82eb60091772ecea73cbc5a8fb7562fc45) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
1 parent a3d33ce commit 9e5074f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

sound/usb/endpoint.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1386,7 +1386,8 @@ int snd_usb_endpoint_set_params(struct snd_usb_audio *chip,
13861386
if (ep->packsize[1] > ep->maxpacksize) {
13871387
usb_audio_dbg(chip, "Too small maxpacksize %u for rate %u / pps %u\n",
13881388
ep->maxpacksize, ep->cur_rate, ep->pps);
1389-
return -EINVAL;
1389+
err = -EINVAL;
1390+
goto unlock;
13901391
}
13911392

13921393
/* calculate the frequency in 16.16 format */

0 commit comments

Comments
 (0)