Patchwork [3.5.yuz,extended,stable] Patch "ALSA: hda - Always check array bounds in" has been added to staging queue

mail settings
Submitter Herton Ronaldo Krzesinski
Date Nov. 21, 2012, 5:09 a.m.
Message ID <>
Download mbox | patch
Permalink /patch/200564/
State New
Headers show


Herton Ronaldo Krzesinski - Nov. 21, 2012, 5:09 a.m.
This is a note to let you know that I have just added a patch titled

    ALSA: hda - Always check array bounds in

to the linux-3.5.y-queue branch of the 3.5.yuz extended stable tree 
which can be found at:;a=shortlog;h=refs/heads/linux-3.5.y-queue

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.5.yuz tree, see



From f4e17d92b3c0f6924c2eb2d6f6c465c2e0665669 Mon Sep 17 00:00:00 2001
From: David Henningsson <>
Date: Wed, 17 Oct 2012 12:43:44 +0200
Subject: [PATCH] ALSA: hda - Always check array bounds in

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 <>
Signed-off-by: Takashi Iwai <>
Signed-off-by: Herton Ronaldo Krzesinski <>
 sound/pci/hda/patch_realtek.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)



diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index f6784d7..2549f0b 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -2486,8 +2486,10 @@  static const char *alc_get_line_out_pfx(struct alc_spec *spec, int ch,
 			return "PCM";
-	if (snd_BUG_ON(ch >= ARRAY_SIZE(channel_name)))
+	if (ch >= ARRAY_SIZE(channel_name)) {
+		snd_BUG();
 		return "PCM";
+	}

 	return channel_name[ch];