summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Henningsson <david.henningsson@canonical.com>2012-10-17 12:43:44 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-21 09:32:43 -0700
commita2ffa569f0808f2ec15cda2198ab4ebc98731aab (patch)
tree5fae0d01d271aa37ea678688047928e0f19824ca
parent5831e4dc072b50a8dc77e69d9247588f8559116c (diff)
downloadlinux-stable-a2ffa569f0808f2ec15cda2198ab4ebc98731aab.tar.gz
linux-stable-a2ffa569f0808f2ec15cda2198ab4ebc98731aab.tar.bz2
linux-stable-a2ffa569f0808f2ec15cda2198ab4ebc98731aab.zip
ALSA: hda - Always check array bounds in alc_get_line_out_pfx
commit 71aa5ebe36a4e936eff281b375a4707b6a8320f2 upstream. 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. Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-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 b5d7850c3846..155cbd260f13 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -2629,8 +2629,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];
}