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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



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





[Index of Archives]     [Pulseaudio]     [Linux Audio Users]     [ALSA Devel]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux