public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Adrian Bunk <bunk@stusta.de>
To: Clement Guedez <klem.dev@gmail.com>
Cc: Takashi Iwai <tiwai@suse.de>, Jaroslav Kysela <perex@suse.cz>,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: [RFC: 2.6.21 patch] fix sound/pci/ice1712/wtm.c:wtm_init()
Date: Mon, 19 Mar 2007 10:24:38 +0100	[thread overview]
Message-ID: <20070319092438.GL752@stusta.de> (raw)

The Coverity checker spotted this bogus for() loop that produces an 
array overrun.

It seems what actually should be done is quite simple?

Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

 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;
 }
 


             reply	other threads:[~2007-03-19  9:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-19  9:24 Adrian Bunk [this message]
2007-03-19 10:27 ` [RFC: 2.6.21 patch] fix sound/pci/ice1712/wtm.c:wtm_init() Takashi Iwai
2007-03-19 13:08   ` Adrian Bunk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070319092438.GL752@stusta.de \
    --to=bunk@stusta.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=klem.dev@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@suse.cz \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox