Re: [PATCH] ALSA: usb-audio: qcom: Initialize offload control return value

From: Takashi Iwai

Date: Fri Jun 05 2026 - 07:15:07 EST


On Fri, 05 Jun 2026 06:14:40 +0200,
Cássio Gabriel wrote:
>
> 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@xxxxxxxxx>

Applied to for-next branch now. Thanks.


Takashi