From: Stephen Warren Date: Thu, 2 Jun 2011 22:44:39 +0000 (-0600) Subject: UCM: Fix deadlock following failed get _verb X-Git-Tag: v1.0.25~29 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=0a4b1ee746c1cfbfdfe586ce5f97b047fcad09f8;p=alsa-lib.git UCM: Fix deadlock following failed get _verb When querying the current verb without a verb set, snd_use_case_get bails out early without unlocking uc_mgr->mutex. This causes subsequent API calls to hang. Instead, s/return/goto __end/. Signed-off-by: Stephen Warren Signed-off-by: Jaroslav Kysela --- diff --git a/src/ucm/main.c b/src/ucm/main.c index f8ceeebd..fb4aa910 100644 --- a/src/ucm/main.c +++ b/src/ucm/main.c @@ -1132,8 +1132,10 @@ int snd_use_case_get(snd_use_case_mgr_t *uc_mgr, } err = 0; } else if (strcmp(identifier, "_verb") == 0) { - if (uc_mgr->active_verb == NULL) - return -ENOENT; + if (uc_mgr->active_verb == NULL) { + err = -ENOENT; + goto __end; + } *value = strdup(uc_mgr->active_verb->name); if (*value == NULL) { err = -ENOMEM;