summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorDavid Henningsson <david.henningsson@canonical.com>2012-10-17 12:43:44 +0200
committerTakashi Iwai <tiwai@suse.de>2012-10-17 13:00:18 +0200
commit71aa5ebe36a4e936eff281b375a4707b6a8320f2 (patch)
tree9542a61abab309a883af0a6fcabfc6544d3afc75 /sound
parent1f04661fde9deda4a2cd5845258715a22d8af197 (diff)
downloadlinux-71aa5ebe36a4e936eff281b375a4707b6a8320f2.tar.gz
linux-71aa5ebe36a4e936eff281b375a4707b6a8320f2.tar.bz2
linux-71aa5ebe36a4e936eff281b375a4707b6a8320f2.zip
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,
return "PCM";
break;
}
- if (snd_BUG_ON(ch >= ARRAY_SIZE(channel_name)))
+ if (ch >= ARRAY_SIZE(channel_name)) {
+ snd_BUG();
return "PCM";
+ }
return channel_name[ch];
}