[Deepin-Kernel-SIG] [linux 6.6.y] [Upstream] ALSA: usb-audio: Fix missing unlock at error path of maxpacksize check#1466
Conversation
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>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideFixes the error path in the USB audio endpoint parameter setup so that the endpoint mutex is properly unlocked before returning when maxpacksize is too small, mirroring upstream behavior on older stable kernels. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
/approve |
There was a problem hiding this comment.
Pull request overview
Fixes a mutex leak in the error path of USB audio endpoint parameter setup on older stable kernels, aligning behavior with upstream’s guard-based locking.
Changes:
- Replace a direct
return -EINVALwitherr = -EINVAL; goto unlock;whenmaxpacksizeis too small. - Ensure
chip->mutexis always released before returning fromsnd_usb_endpoint_set_params().
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9e5074f
into
deepin-community:linux-6.6.y
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Avenger-285714, lanlanxiyiji The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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
(cherry picked from commit fdf0dc82eb60091772ecea73cbc5a8fb7562fc45)
Summary by Sourcery
Bug Fixes: