Skip to content

Commit

Permalink
ALSA: usb-audio: correct the value cache check.
Browse files Browse the repository at this point in the history
The check of cval->cached should be zero-based (including master channel).

Signed-off-by: Yao-Wen Mao <yaowen@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Yao-Wen Mao authored and Takashi Iwai committed Aug 28, 2015
1 parent 0662292 commit 6aa6925
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/usb/mixer.c
Original file line number Diff line number Diff line change
Expand Up @@ -2540,7 +2540,7 @@ static int restore_mixer_value(struct usb_mixer_elem_list *list)
for (c = 0; c < MAX_CHANNELS; c++) {
if (!(cval->cmask & (1 << c)))
continue;
if (cval->cached & (1 << c)) {
if (cval->cached & (1 << (c + 1))) {
err = snd_usb_set_cur_mix_value(cval, c + 1, idx,
cval->cache_val[idx]);
if (err < 0)
Expand Down

0 comments on commit 6aa6925

Please sign in to comment.