aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorDavid Henningsson <david.henningsson@canonical.com>2012-10-17 06:43:44 -0400
committerTakashi Iwai <tiwai@suse.de>2012-10-17 07:00:18 -0400
commit71aa5ebe36a4e936eff281b375a4707b6a8320f2 (patch)
tree9542a61abab309a883af0a6fcabfc6544d3afc75 /sound
parent1f04661fde9deda4a2cd5845258715a22d8af197 (diff)
ALSA: hda - Always check array bounds in alc_get_line_out_pfx
Even when CONFIG_SND_DEBUG is not enabled, we don't want to return an arbitrary memory location when the channel count is larger than we expected. Cc: stable@kernel.org Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/patch_realtek.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 8253b4eeb6a1..48d9d609f89b 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -2598,8 +2598,10 @@ static const char *alc_get_line_out_pfx(struct alc_spec *spec, int ch,
2598 return "PCM"; 2598 return "PCM";
2599 break; 2599 break;
2600 } 2600 }
2601 if (snd_BUG_ON(ch >= ARRAY_SIZE(channel_name))) 2601 if (ch >= ARRAY_SIZE(channel_name)) {
2602 snd_BUG();
2602 return "PCM"; 2603 return "PCM";
2604 }
2603 2605
2604 return channel_name[ch]; 2606 return channel_name[ch];
2605} 2607}