From: Dan Carpenter Date: Thu, 7 Feb 2013 08:28:48 +0000 (+0300) Subject: ALSA: ice1712: fix boundary check in snd_wm8766_write() X-Git-Tag: next-20130218~63^2~31 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=b57a895fa2188d4e1cefa030d0fc9d126e453a95;p=karo-tx-linux.git ALSA: ice1712: fix boundary check in snd_wm8766_write() The wm->regs[] array has WM8766_REG_COUNT (16) elements not WM8766_REG_RESET (31). Signed-off-by: Dan Carpenter Signed-off-by: Takashi Iwai --- diff --git a/sound/pci/ice1712/wm8766.c b/sound/pci/ice1712/wm8766.c index 8072adeecf68..e473f8a88f9c 100644 --- a/sound/pci/ice1712/wm8766.c +++ b/sound/pci/ice1712/wm8766.c @@ -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); }