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 <swarren@nvidia.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Stephen Warren 2011-06-03 14:56:34 -06:00 committed by Takashi Iwai
parent 32d24f4071
commit a48f67c0ed

View 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) {