Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ALSA: hda: cs35l41: Fix NULL pointer dereference in cs35l41_hda_read_acpi()

The acpi_get_first_physical_node() function can return NULL, in which
case the get_device() function also returns NULL, but this value is
then dereferenced without checking,so add a check to prevent a crash.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 7b2f3eb492da ("ALSA: hda: cs35l41: Add support for CS35L41 in HDA systems")
Cc: stable@vger.kernel.org
Signed-off-by: Denis Arefev <arefev@swemel.ru>
Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20251202101338.11437-1-arefev@swemel.ru

authored by

Denis Arefev and committed by
Takashi Iwai
c34b04cc eaf526cf

+2
+2
sound/hda/codecs/side-codecs/cs35l41_hda.c
··· 1901 1901 1902 1902 cs35l41->dacpi = adev; 1903 1903 physdev = get_device(acpi_get_first_physical_node(adev)); 1904 + if (!physdev) 1905 + return -ENODEV; 1904 1906 1905 1907 sub = acpi_get_subsystem_id(ACPI_HANDLE(physdev)); 1906 1908 if (IS_ERR(sub))