]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ALSA: usb-audio: qcom: Initialize offload control return value
authorCássio Gabriel <cassiogabrielcontato@gmail.com>
Fri, 5 Jun 2026 04:14:40 +0000 (01:14 -0300)
committerTakashi Iwai <tiwai@suse.de>
Fri, 5 Jun 2026 11:13:55 +0000 (13:13 +0200)
commit2b5632d72fca0841bea283da2e3a478d24118508
treeb503e572533c2903bbb8e0ecf779446b9b71403e
parent5061b090db75c9fb98c8024779f771d92e5cf3a8
ALSA: usb-audio: qcom: Initialize offload control return value

snd_usb_offload_create_ctl() returns ret after walking the USB PCM list,
but ret is only assigned after a playback stream passes the endpoint and
PCM-index filters.

If all playback streams are skipped, for example because there is no
playback endpoint or because all PCM indexes exceed the 0xff control
range, the function returns an uninitialized stack value.

Initialize ret to 0 so the no-control-created path returns deterministic
success, while preserving the existing negative error return when
snd_ctl_add() fails.

Fixes: a67656f011d1 ("ALSA: usb-audio: qcom: Add USB offload route kcontrol")
Signed-off-by: Cássio Gabriel <cassiogabrielcontato@gmail.com>
Link: https://patch.msgid.link/20260605-alsa-usb-qcom-offload-ret-init-v1-1-dc72fcc4bd3b@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/qcom/mixer_usb_offload.c