]> git.alsa-project.org Git - alsa-lib.git/commitdiff
UCM: snd_use_case_get: Don't segfault when no current verb
authorStephen Warren <swarren@nvidia.com>
Fri, 3 Jun 2011 20:56:34 +0000 (14:56 -0600)
committerTakashi Iwai <tiwai@suse.de>
Wed, 8 Jun 2011 16:21:46 +0000 (18:21 +0200)
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 <swarren@nvidia.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
src/ucm/main.c

index db71f03056e8aa769ee58e4691f6051e1f4e1b1b..13ea1ed0a78c21b1f5080ac82a44859fcf2a54f9 100644 (file)
@@ -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) {