Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
* [PATCH] ASoC: qcom: sdm845: Add error handling in sdm845_slim_snd_hw_params()
@ 2025-05-19  7:57 Wentao Liang
  2025-05-19 11:00 ` Dmitry Baryshkov
  2025-05-22  8:45 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Wentao Liang @ 2025-05-19  7:57 UTC (permalink / raw)
  To: srinivas.kandagatla, lgirdwood, broonie, perex, tiwai
  Cc: linux-sound, linux-arm-msm, linux-kernel, Wentao Liang, stable

The function sdm845_slim_snd_hw_params() calls the functuion
snd_soc_dai_set_channel_map() but does not check its return
value. A proper implementation can be found in msm_snd_hw_params().

Add error handling for snd_soc_dai_set_channel_map(). If the
function fails and it is not a unsupported error, return the
error code immediately.

Fixes: 5caf64c633a3 ("ASoC: qcom: sdm845: add support to DB845c and Lenovo Yoga")
Cc: stable@vger.kernel.org # v5.6
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
 sound/soc/qcom/sdm845.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sound/soc/qcom/sdm845.c b/sound/soc/qcom/sdm845.c
index a479d7e5b7fb..314ff68506d9 100644
--- a/sound/soc/qcom/sdm845.c
+++ b/sound/soc/qcom/sdm845.c
@@ -91,6 +91,10 @@ static int sdm845_slim_snd_hw_params(struct snd_pcm_substream *substream,
 		else
 			ret = snd_soc_dai_set_channel_map(cpu_dai, tx_ch_cnt,
 							  tx_ch, 0, NULL);
+		if (ret != 0 && ret != -ENOTSUPP) {
+			dev_err(rtd->dev, "failed to set cpu chan map, err:%d\n", ret);
+			return ret;
+		}
 	}
 
 	return 0;
-- 
2.42.0.windows.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-05-22  8:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-19  7:57 [PATCH] ASoC: qcom: sdm845: Add error handling in sdm845_slim_snd_hw_params() Wentao Liang
2025-05-19 11:00 ` Dmitry Baryshkov
2025-05-22  8:45 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox