mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
tuning_ctl_set() might have buffer overrun at (X) if it didn't break
from loop by matching (A).
static int tuning_ctl_set(...)
{
for (i = 0; i < TUNING_CTLS_COUNT; i++)
(A) if (nid == ca0132_tuning_ctls[i].nid)
break;
snd_hda_power_up(...);
(X) dspio_set_param(..., ca0132_tuning_ctls[i].mid, ...);
snd_hda_power_down(...); ^
return 1;
}
We will get below error by cppcheck
sound/pci/hda/patch_ca0132.c:4229:2: note: After for loop, i has value 12
for (i = 0; i < TUNING_CTLS_COUNT; i++)
^
sound/pci/hda/patch_ca0132.c:4234:43: note: Array index out of bounds
dspio_set_param(codec, ca0132_tuning_ctls[i].mid, 0x20,
^
This patch cares non match case.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87sfe9eap7.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
||
|---|---|---|
| .. | ||
| ac97 | ||
| ali5451 | ||
| asihpi | ||
| au88x0 | ||
| aw2 | ||
| ca0106 | ||
| cs46xx | ||
| cs5535audio | ||
| ctxfi | ||
| echoaudio | ||
| emu10k1 | ||
| hda | ||
| ice1712 | ||
| korg1212 | ||
| lola | ||
| lx6464es | ||
| mixart | ||
| nm256 | ||
| oxygen | ||
| pcxhr | ||
| riptide | ||
| rme9652 | ||
| trident | ||
| vx222 | ||
| ymfpci | ||
| ad1889.c | ||
| ad1889.h | ||
| ak4531_codec.c | ||
| als300.c | ||
| als4000.c | ||
| atiixp.c | ||
| atiixp_modem.c | ||
| azt3328.c | ||
| azt3328.h | ||
| bt87x.c | ||
| cmipci.c | ||
| cs4281.c | ||
| cs5530.c | ||
| ens1370.c | ||
| ens1371.c | ||
| es1938.c | ||
| es1968.c | ||
| fm801.c | ||
| intel8x0.c | ||
| intel8x0m.c | ||
| Kconfig | ||
| maestro3.c | ||
| Makefile | ||
| rme32.c | ||
| rme96.c | ||
| sis7019.c | ||
| sis7019.h | ||
| sonicvibes.c | ||
| via82xx.c | ||
| via82xx_modem.c | ||