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

ALSA: pcm: Harden the spk_alloc assumption check

If the parsed ELD has spk_alloc=0, it currently assigns the parsed ELD
spk_alloc to 0xffff. However, we should also check if there is at least
one SAD (Short audio descriptor) to enforce the assumption, as ELD
without any sad_count, is usually considered invalid for e.g. in
commit ce9778b7a0272("ALSA: hda/hdmi: Consider ELD is invalid when no
SAD is present").

Signed-off-by: Umang Jain <uajain@igalia.com>
Link: https://patch.msgid.link/20251120141757.901505-1-uajain@igalia.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Umang Jain and committed by
Takashi Iwai
9ef1203f c639065e

+1 -1
+1 -1
sound/core/pcm_drm_eld.c
··· 379 379 * in console or for audio devices. Assume the highest speakers 380 380 * configuration, to _not_ prohibit multi-channel audio playback. 381 381 */ 382 - if (!e->spk_alloc) 382 + if (!e->spk_alloc && e->sad_count) 383 383 e->spk_alloc = 0xffff; 384 384 385 385 return 0;