Skip to content

Commit 8527bbb

Browse files
Denis Arefevtiwai
authored andcommitted
ALSA: hda: cs35l41: Fix NULL pointer dereference in cs35l41_get_acpi_mute_state()
Return value of a function acpi_evaluate_dsm() is dereferenced without checking for NULL, but it is usually checked for this function. acpi_evaluate_dsm() may return NULL, when acpi_evaluate_object() returns acpi_status other than ACPI_SUCCESS, so add a check to prevent the crach. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 447106e ("ALSA: hda: cs35l41: Support mute notifications for CS35L41 HDA") Cc: [email protected] Signed-off-by: Denis Arefev <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
1 parent ca7a231 commit 8527bbb

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
@@ -1410,6 +1410,8 @@ static int cs35l41_get_acpi_mute_state(struct cs35l41_hda *cs35l41, acpi_handle
14101410

14111411
if (cs35l41_dsm_supported(handle, CS35L41_DSM_GET_MUTE)) {
14121412
ret = acpi_evaluate_dsm(handle, &guid, 0, CS35L41_DSM_GET_MUTE, NULL);
1413+
if (!ret)
1414+
return -EINVAL;
14131415
mute = *ret->buffer.pointer;
14141416
dev_dbg(cs35l41->dev, "CS35L41_DSM_GET_MUTE: %d\n", mute);
14151417
}

0 commit comments

Comments
 (0)