Skip to contentSkip to conversation

ALSA: ice1712: fix boundary check in snd_wm8766_write()

PATCH Applied Dan Carpenter 2 participants 2 messages Feb 7, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: ice1712: fix boundary check in snd_wm8766_write()

The wm->regs[] array has WM8766_REG_COUNT (16) elements not WM8766_REG_RESET (31).

---
This is a static checker thing, I can't test it.

sound/pci/ice1712/wm8766.c +1 -1
index 8072ade..e473f8a 100644
@@ -31,7 +31,7 @@
 
 static void snd_wm8766_write(struct snd_wm8766 *wm, u16 addr, u16 data)
 {
-	if (addr < WM8766_REG_RESET)
+	if (addr < WM8766_REG_COUNT)
 		wm->regs[addr] = data;
 	wm->ops.write(wm, addr, data);
 }
Applied
#1 lore raw

At Thu, 7 Feb 2013 11:28:48 +0300,

Quoted 7 lines · Dan Carpenter

The wm->regs[] array has WM8766_REG_COUNT (16) elements not WM8766_REG_RESET (31).

---
This is a static checker thing, I can't test it.

Thanks, applied it now.

Takashi

Quoted 15 lines
sound/pci/ice1712/wm8766.c +1 -1
index 8072ade..e473f8a 100644
@@ -31,7 +31,7 @@
 
 static void snd_wm8766_write(struct snd_wm8766 *wm, u16 addr, u16 data)
 {
-	if (addr < WM8766_REG_RESET)
+	if (addr < WM8766_REG_COUNT)
 		wm->regs[addr] = data;
 	wm->ops.write(wm, addr, data);
 }