Skip to content

Commit 688abe2

Browse files
ISCAS-Vulabbroonie
authored andcommitted
ASoC: qcom: sdm845: Add error handling in sdm845_slim_snd_hw_params()
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: 5caf64c ("ASoC: qcom: sdm845: add support to DB845c and Lenovo Yoga") Cc: [email protected] # v5.6 Signed-off-by: Wentao Liang <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent e717c66 commit 688abe2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sound/soc/qcom/sdm845.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ static int sdm845_slim_snd_hw_params(struct snd_pcm_substream *substream,
9191
else
9292
ret = snd_soc_dai_set_channel_map(cpu_dai, tx_ch_cnt,
9393
tx_ch, 0, NULL);
94+
if (ret != 0 && ret != -ENOTSUPP) {
95+
dev_err(rtd->dev, "failed to set cpu chan map, err:%d\n", ret);
96+
return ret;
97+
}
9498
}
9599

96100
return 0;

0 commit comments

Comments
 (0)