[PATCH 3/4] ALSA: usb-audio: qcom: Fix return value in qc_usb_audio_offload_fill_avail_pcms
From: wangdich9700
Date: Wed Jun 03 2026 - 05:21:36 EST
From: wangdicheng <wangdicheng@xxxxxxxxxx>
The function qc_usb_audio_offload_fill_avail_pcms() always returns -1
regardless of how many PCM devices were successfully filled. This makes
it impossible for callers to know the actual number of available PCMs.
Return the actual count of filled PCM devices instead, which allows
callers to verify that all expected PCMs were properly enumerated.
Signed-off-by: wangdicheng <wangdicheng@xxxxxxxxxx>
---
sound/usb/qcom/qc_audio_offload.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/usb/qcom/qc_audio_offload.c b/sound/usb/qcom/qc_audio_offload.c
index f99f8bddb237..fa7ee61d6934 100644
--- a/sound/usb/qcom/qc_audio_offload.c
+++ b/sound/usb/qcom/qc_audio_offload.c
@@ -1753,7 +1753,7 @@ static int qc_usb_audio_offload_fill_avail_pcms(struct snd_usb_audio *chip,
break;
}
- return -1;
+ return idx;
}
/**
--
2.25.1