linux-stable/sound
Xiaomeng Tong a55e2d7423 ALSA: cs4236: fix an incorrect NULL check on list iterator
commit 0112f822f8 upstream.

The bug is here:
	err = snd_card_cs423x_pnp(dev, card->private_data, pdev, cdev);

The list iterator value 'cdev' will *always* be set and non-NULL
by list_for_each_entry(), so it is incorrect to assume that the
iterator value will be NULL if the list is empty or no element
is found.

To fix the bug, use a new variable 'iter' as the list iterator,
while use the original variable 'cdev' as a dedicated pointer
to point to the found element. And snd_card_cs423x_pnp() itself
has NULL check for cdev.

Cc: stable@vger.kernel.org
Fixes: c2b73d1458 ("ALSA: cs4236: cs4232 and cs4236 driver merge to solve PnP BIOS detection")
Signed-off-by: Xiaomeng Tong <xiam0nd.tong@gmail.com>
Link: https://lore.kernel.org/r/20220327060822.4735-1-xiam0nd.tong@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-08 14:39:53 +02:00
..
ac97 ALSA: ac97: fix PM reference leak in ac97_bus_remove() 2021-07-20 16:05:40 +02:00
aoa
arm
atmel
core ALSA: pcm: Add stream lock during PCM reset ioctl operations 2022-03-28 09:57:09 +02:00
drivers ALSA: drivers: opl3: Fix incorrect use of vp->state 2021-12-29 12:26:00 +01:00
firewire ALSA: firewire-motu: fix detection for S/PDIF source on optical interface in v2 protocol 2021-07-20 16:05:45 +02:00
hda ALSA: intel-dsp-config: add quirk for CML devices based on ES8336 codec 2021-12-08 09:03:25 +01:00
i2c
isa ALSA: cs4236: fix an incorrect NULL check on list iterator 2022-04-08 14:39:53 +02:00
mips hal2: convert to dma_alloc_noncoherent 2020-09-25 06:20:44 +02:00
oss
parisc
pci ALSA: pci: fix reading of swapped values from pcmreg in AC97 codec 2022-03-28 09:57:09 +02:00
pcmcia
ppc ALSA: ppc: fix error return code in snd_pmac_probe() 2021-07-20 16:05:43 +02:00
sh
soc ASoC: sti: Fix deadlock via snd_pcm_stop_xrun() call 2022-03-28 09:57:08 +02:00
sparc ALSA: sparc: dbri: fix repeated word 'the' 2020-10-17 09:58:35 +02:00
spi
synth ALSA: synth: missing check for possible NULL after the call to kstrdup 2021-11-18 14:03:40 +01:00
usb ALSA: usb-audio: Add mute TLV for playback volumes on RODE NT-USB 2022-03-28 09:57:09 +02:00
x86 ALSA: intel_hdmi: Fix reference to PCM buffer address 2022-03-08 19:09:31 +01:00
xen
ac97_bus.c
Kconfig
last.c
Makefile
sound_core.c