mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-31 22:25:35 -04:00
ucm: fix switch device & modifier when no transition is found
Fix some logic bugs in switch device and switch modifier when transition sequences are not found. Also fix check for new device. Reported-by: w0806.kim@samsung.com Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
This commit is contained in:
parent
e1b4bd6c89
commit
a618cdf057
1 changed files with 3 additions and 3 deletions
|
|
@ -1305,7 +1305,7 @@ static int switch_device(snd_use_case_mgr_t *uc_mgr,
|
|||
if (xold == NULL)
|
||||
return -ENOENT;
|
||||
xnew = find_device(uc_mgr->active_verb, new_device);
|
||||
if (xold == NULL)
|
||||
if (xnew == NULL)
|
||||
return -ENOENT;
|
||||
err = 0;
|
||||
list_for_each(pos, &xold->transition_list) {
|
||||
|
|
@ -1327,7 +1327,7 @@ static int switch_device(snd_use_case_mgr_t *uc_mgr,
|
|||
err = set_device(uc_mgr, xold, 0);
|
||||
if (err < 0)
|
||||
return err;
|
||||
err = set_device(uc_mgr, xnew, 0);
|
||||
err = set_device(uc_mgr, xnew, 1);
|
||||
if (err < 0)
|
||||
return err;
|
||||
}
|
||||
|
|
@ -1379,7 +1379,7 @@ static int switch_modifier(snd_use_case_mgr_t *uc_mgr,
|
|||
err = set_modifier(uc_mgr, xold, 0);
|
||||
if (err < 0)
|
||||
return err;
|
||||
err = set_modifier(uc_mgr, xnew, 0);
|
||||
err = set_modifier(uc_mgr, xnew, 1);
|
||||
if (err < 0)
|
||||
return err;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue