[PATCH] ASoC: soc-pcm: add the judgment of unsupported commands for the function soc_pcm_trigger

From: xuhanwu
Date: Fri Mar 08 2024 - 05:08:04 EST


From: xuhanwu <xu.hanwu@xxxxxxxxxx>

Function soc_pcm_trigger, if the parameter cmd does not support the need to return an error (-EINVAL).

Signed-off-by: xuhanwu <xu.hanwu@xxxxxxxxxx>
---
sound/soc/soc-pcm.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 77ee103b7..eba737729 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -1173,6 +1173,9 @@ static int soc_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
if (r < 0)
break;
}
+ break;
+ default:
+ return -EINVAL;
}

/*
--
2.17.1