Skip to content

Commit c34b04c

Browse files
Denis Arefevtiwai
authored andcommitted
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: 7b2f3eb ("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
1 parent eaf526c commit c34b04c

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

sound/hda/codecs/side-codecs/cs35l41_hda.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1901,6 +1901,8 @@ static int cs35l41_hda_read_acpi(struct cs35l41_hda *cs35l41, const char *hid, i
19011901

19021902
cs35l41->dacpi = adev;
19031903
physdev = get_device(acpi_get_first_physical_node(adev));
1904+
if (!physdev)
1905+
return -ENODEV;
19041906

19051907
sub = acpi_get_subsystem_id(ACPI_HANDLE(physdev));
19061908
if (IS_ERR(sub))

0 commit comments

Comments
 (0)