From mboxrd@z Thu Jan 1 00:00:00 1970 From: Axel Lin Subject: [PATCH 2/2] ASoC: Add BUG() assertion if max98095_get_bq_channel returns -EINVAL Date: Wed, 28 Sep 2011 22:02:10 +0800 Message-ID: <1317218530.8008.4.camel@phoenix> References: <1317218471.8008.3.camel@phoenix> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1317218471.8008.3.camel@phoenix> Sender: linux-kernel-owner@vger.kernel.org To: linux-kernel@vger.kernel.org Cc: Liam Girdwood , Mark Brown , alsa-devel@alsa-project.org, Peter Hsiang , Jesse Marroquin List-Id: alsa-devel@alsa-project.org The callers use the return value of max98095_get_bq_channel as array index to access max98095->dai[] array. Add BUG() assertion for out of bound access of max98095->dai[] array. Signed-off-by: Axel Lin --- sound/soc/codecs/max98095.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/sound/soc/codecs/max98095.c b/sound/soc/codecs/max98095.c index 668434d..973c02d 100644 --- a/sound/soc/codecs/max98095.c +++ b/sound/soc/codecs/max98095.c @@ -1998,6 +1998,7 @@ static int max98095_get_bq_channel(const char *name) return 0; if (strcmp(name, "Biquad2 Mode") == 0) return 1; + BUG(); return -EINVAL; } -- 1.7.4.1