mirror of
https://github.com/torvalds/linux.git
synced 2026-06-10 07:32:29 +02:00
ALSA: hda - Always check array bounds in alc_get_line_out_pfx
commit 71aa5ebe36 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>
This commit is contained in:
parent
7ec51fc741
commit
bb4e97376e
|
|
@ -2665,8 +2665,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];
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user