All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ASoC: Add BUG() assertion if max98088_get_channel returns -EINVAL
@ 2011-09-28 14:01 Axel Lin
  2011-09-28 14:02 ` [PATCH 2/2] ASoC: Add BUG() assertion if max98095_get_bq_channel " Axel Lin
  2011-09-28 23:15 ` [PATCH 1/2] ASoC: Add BUG() assertion if max98088_get_channel " Ryan Mallon
  0 siblings, 2 replies; 14+ messages in thread
From: Axel Lin @ 2011-09-28 14:01 UTC (permalink / raw)
  To: linux-kernel
  Cc: Liam Girdwood, Mark Brown, alsa-devel, Peter Hsiang, Jesse Marroquin

The callers use the return value of max98088_get_channel as array index to
access max98088->dai[] array.
Add BUG() assertion for out of bound access of max98088->dai[] array.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 sound/soc/codecs/max98088.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/sound/soc/codecs/max98088.c b/sound/soc/codecs/max98088.c
index ac65a2d..aaca91c 100644
--- a/sound/soc/codecs/max98088.c
+++ b/sound/soc/codecs/max98088.c
@@ -1703,6 +1703,7 @@ static int max98088_get_channel(const char *name)
                return 0;
        if (strcmp(name, "EQ2 Mode") == 0)
                return 1;
+	BUG();
        return -EINVAL;
 }
 
-- 
1.7.4.1




^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2011-09-30 12:56 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-28 14:01 [PATCH 1/2] ASoC: Add BUG() assertion if max98088_get_channel returns -EINVAL Axel Lin
2011-09-28 14:02 ` [PATCH 2/2] ASoC: Add BUG() assertion if max98095_get_bq_channel " Axel Lin
2011-09-28 23:19   ` Ryan Mallon
2011-09-29  1:35     ` Dave Young
2011-09-29  1:52       ` Ryan Mallon
2011-09-29  1:59         ` Dave Young
2011-09-29  2:01           ` Ryan Mallon
2011-09-29  2:06             ` Dave Young
2011-09-29  1:33   ` Dave Young
2011-09-28 23:15 ` [PATCH 1/2] ASoC: Add BUG() assertion if max98088_get_channel " Ryan Mallon
2011-09-29 10:34   ` Mark Brown
2011-09-29 11:28     ` Ryan Mallon
2011-09-29 23:13     ` Ryan Mallon
2011-09-30 12:56       ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.