linux/sound
Kuninori Morimoto 98e5eb1100 ALSA: hda/ca0132: fixup buffer overrun at tuning_ctl_set()
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>
2023-03-14 17:04:53 +01:00
..
ac97 ALSA: ac97: make remove callback of ac97 driver void returned 2023-01-25 09:34:20 +01:00
aoa Driver core changes for 6.3-rc1 2023-02-24 12:58:55 -08:00
arm ALSA: arm: pxa: pxa2xx-ac97-lib: fix return value check of platform_get_irq() 2022-10-29 10:45:27 +02:00
atmel
core - Daniel Verkamp has contributed a memfd series ("mm/memfd: add 2023-02-23 17:09:35 -08:00
drivers ALSA: mts64: fix possible null-ptr-defer in snd_mts64_interrupt 2022-12-06 11:12:12 +01:00
firewire Merge branch 'topic/apple-gmux' into for-next 2023-02-16 14:18:54 +01:00
hda ALSA: hda: intel-dsp-config: add MTL PCI id 2023-03-08 06:37:19 +01:00
i2c treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
isa ALSA: sb: Use DIV_ROUND_UP() instead of open-coding it 2022-09-29 08:11:55 +02:00
mips
oss
parisc
pci ALSA: hda/ca0132: fixup buffer overrun at tuning_ctl_set() 2023-03-14 17:04:53 +01:00
pcmcia
ppc ALSA: ppc: fix unused function local variable 2023-02-09 08:04:36 +01:00
sh
soc ASoC: hdmi-codec: only startup/shutdown on supported streams 2023-03-09 13:45:31 +00:00
sparc
spi
synth ALSA: emux: Avoid potential array out-of-bound in snd_emux_xg_control() 2023-02-07 14:32:33 +01:00
usb - Daniel Verkamp has contributed a memfd series ("mm/memfd: add 2023-02-23 17:09:35 -08:00
virtio
x86
xen xen: make remove callback of xen driver void returned 2022-12-15 16:06:10 +01:00
ac97_bus.c
Kconfig mfd: remove ucb1400 support 2023-02-01 17:23:38 +01:00
last.c
Makefile
sound_core.c driver core: make struct class.devnode() take a const * 2022-11-24 17:12:27 +01:00