From: Takashi Iwai Subject: [PATCH 9/9] ASoC: wm8996: Fix negative array index read Date: Wed, 30 Oct 2013 08:35:07 +0100 Message-ID: <1383118507-21503-10-git-send-email-tiwai@suse.de> References: <1383118507-21503-1-git-send-email-tiwai@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 56FE6264F4A for ; Wed, 30 Oct 2013 08:32:34 +0100 (CET) In-Reply-To: <1383118507-21503-1-git-send-email-tiwai@suse.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Mark Brown Cc: alsa-devel@alsa-project.org, Liam Girdwood List-Id: alsa-devel@alsa-project.org Spotted by coverity CID 146355. Signed-off-by: Takashi Iwai --- sound/soc/codecs/wm8996.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/codecs/wm8996.c b/sound/soc/codecs/wm8996.c index 46fe83d2b224..b70379ebd142 100644 --- a/sound/soc/codecs/wm8996.c +++ b/sound/soc/codecs/wm8996.c @@ -438,6 +438,8 @@ static int wm8996_get_retune_mobile_enum(struct snd_kcontrol *kcontrol, struct wm8996_priv *wm8996 = snd_soc_codec_get_drvdata(codec); int block = wm8996_get_retune_mobile_block(kcontrol->id.name); + if (block < 0) + return block; ucontrol->value.enumerated.item[0] = wm8996->retune_mobile_cfg[block]; return 0; -- 1.8.4.1