[alsa-devel] [PATCH] ucm: Don't crash on attempts to set missing verbs

Mark Brown broonie at opensource.wolfsonmicro.com
Fri Oct 8 23:16:06 CEST 2010


Mostly for the benefit of alsaucm which passes the specified verb (if
any) straight through, but the robustness fix seems better here.

Signed-off-by: Mark Brown <broonie at opensource.wolfsonmicro.com>
---
 src/use-case.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/use-case.c b/src/use-case.c
index b45fe1f..ee44275 100644
--- a/src/use-case.c
+++ b/src/use-case.c
@@ -2786,6 +2786,9 @@ int snd_use_case_set_verb(snd_use_case_mgr_t *uc_mgr,
 {
 	int i = 0, ret = -EINVAL, inactive = 0;
 
+	if (!verb_name)
+		return -EINVAL;
+
 	pthread_mutex_lock(&uc_mgr->mutex);
 
 	uc_dbg("uc_mgr %p, verb_name %s", uc_mgr, verb_name);
-- 
1.7.1



More information about the Alsa-devel mailing list