From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751604AbXCSK1z (ORCPT ); Mon, 19 Mar 2007 06:27:55 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750872AbXCSK1y (ORCPT ); Mon, 19 Mar 2007 06:27:54 -0400 Received: from mx1.suse.de ([195.135.220.2]:38118 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751197AbXCSK1y (ORCPT ); Mon, 19 Mar 2007 06:27:54 -0400 Date: Mon, 19 Mar 2007 11:27:52 +0100 Message-ID: From: Takashi Iwai To: Adrian Bunk Cc: Clement Guedez , Jaroslav Kysela , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: Re: [RFC: 2.6.21 patch] fix sound/pci/ice1712/wtm.c:wtm_init() In-Reply-To: <20070319092438.GL752@stusta.de> References: <20070319092438.GL752@stusta.de> User-Agent: Wanderlust/2.12.0 (Your Wildest Dreams) SEMI/1.14.6 (Maruoka) FLIM/1.14.7 (=?ISO-8859-4?Q?Sanj=F2?=) APEL/10.6 MULE XEmacs/21.5 (beta27) (fiddleheads) (+CVS-20060704) (i386-suse-linux) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org At Mon, 19 Mar 2007 10:24:38 +0100, Adrian Bunk wrote: > > The Coverity checker spotted this bogus for() loop that produces an > array overrun. Hmm, I'm dense now before a caffee, but how can it overrun...? > > It seems what actually should be done is quite simple? Yes... unless someone wants to add more register initializations there. Takashi > > Signed-off-by: Adrian Bunk > > --- > > sound/pci/ice1712/wtm.c | 14 +++----------- > 1 file changed, 3 insertions(+), 11 deletions(-) > > --- linux-2.6.21-rc3-mm2/sound/pci/ice1712/wtm.c.old 2007-03-19 01:29:23.000000000 +0100 > +++ linux-2.6.21-rc3-mm2/sound/pci/ice1712/wtm.c 2007-03-19 01:33:06.000000000 +0100 > @@ -489,23 +489,15 @@ > > static int __devinit wtm_init(struct snd_ice1712 *ice) > { > - static unsigned short stac_inits_prodigy[] = { > - STAC946X_RESET, 0, > - (unsigned short)-1 > - }; > - unsigned short *p; > - > /*WTM 192M*/ > ice->num_total_dacs = 8; > ice->num_total_adcs = 4; > ice->force_rdma1 = 1; > > /*initialize codec*/ > - p = stac_inits_prodigy; > - for (; *p != (unsigned short)-1; p += 2) { > - stac9460_put(ice, p[0], p[1]); > - stac9460_2_put(ice, p[0], p[1]); > - } > + stac9460_put(ice, STAC946X_RESET, 0); > + stac9460_2_put(ice, STAC946X_RESET, 0); > + > return 0; > } > >