]> Gentwo Git Trees - linux/.git/commitdiff
ALSA: pcm: Harden the spk_alloc assumption check
authorUmang Jain <uajain@igalia.com>
Thu, 20 Nov 2025 14:17:57 +0000 (19:47 +0530)
committerTakashi Iwai <tiwai@suse.de>
Fri, 21 Nov 2025 09:35:04 +0000 (10:35 +0100)
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>
sound/core/pcm_drm_eld.c

index 688eefce82fa3d336fcf6458335b75422bddd47b..cb2eebaac85fdbd386c568954afd2fdad5ab8207 100644 (file)
@@ -379,7 +379,7 @@ int snd_parse_eld(struct device *dev, struct snd_parsed_hdmi_eld *e,
         * in console or for audio devices. Assume the highest speakers
         * configuration, to _not_ prohibit multi-channel audio playback.
         */
-       if (!e->spk_alloc)
+       if (!e->spk_alloc && e->sad_count)
                e->spk_alloc = 0xffff;
 
        return 0;