From: Takashi Iwai Subject: Re: [PATCH 9/9] ASoC: wm8996: Fix negative array index read Date: Wed, 30 Oct 2013 18:33:39 +0100 Message-ID: References: <1383118507-21503-1-git-send-email-tiwai@suse.de> <1383118507-21503-10-git-send-email-tiwai@suse.de> <20131030165103.GJ2493@sirena.org.uk> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") 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 4216A265528 for ; Wed, 30 Oct 2013 18:33:39 +0100 (CET) In-Reply-To: <20131030165103.GJ2493@sirena.org.uk> 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 At Wed, 30 Oct 2013 09:51:03 -0700, Mark Brown wrote: > > On Wed, Oct 30, 2013 at 08:35:07AM +0100, Takashi Iwai wrote: > > > 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]; > > Applied, but this only fixes some of the problem - there's nothing > validating that block is in bounds for the array, this now adds code > which validates the lower but not upper bound for this. The function returns either -EINVAL, 0 or 1, so no need for upper bound check. Takashi