aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_codec.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
-rw-r--r--sound/pci/hda/hda_codec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 39240e0ea568..23d3befef57b 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -2337,7 +2337,8 @@ int snd_hda_ch_mode_put(struct hda_codec *codec,
2337 unsigned int mode; 2337 unsigned int mode;
2338 2338
2339 mode = ucontrol->value.enumerated.item[0]; 2339 mode = ucontrol->value.enumerated.item[0];
2340 snd_assert(mode < num_chmodes, return -EINVAL); 2340 if (mode >= num_chmodes)
2341 return -EINVAL;
2341 if (*max_channelsp == chmode[mode].channels) 2342 if (*max_channelsp == chmode[mode].channels)
2342 return 0; 2343 return 0;
2343 /* change the current channel setting */ 2344 /* change the current channel setting */