From: Stephen Warren Date: Fri, 3 Jun 2011 20:56:34 +0000 (-0600) Subject: UCM: snd_use_case_get: Don't segfault when no current verb X-Git-Tag: v1.0.25~23 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=a48f67c0ed7485e10dcbf08f9006a6282ef8ab7d;p=alsa-lib.git UCM: snd_use_case_get: Don't segfault when no current verb get_value, called by snd_use_case_get, uses uc_mgr->active_verb without checking there is one, and hence can segfault. Fix this. Signed-off-by: Stephen Warren Acked-by: Liam Girdwood Signed-off-by: Takashi Iwai --- diff --git a/src/ucm/main.c b/src/ucm/main.c index db71f030..13ea1ed0 100644 --- a/src/ucm/main.c +++ b/src/ucm/main.c @@ -1180,6 +1180,9 @@ static int get_value(snd_use_case_mgr_t *uc_mgr, struct use_case_device *dev; int err; + if (!uc_mgr->active_verb) + return -ENOENT; + if (item != NULL) { mod = find_modifier(uc_mgr, uc_mgr->active_verb, item, 0); if (mod != NULL) {