public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ALSA: pcm: Harden the spk_alloc assumption check
@ 2025-11-20 14:17 Umang Jain
  2025-11-21  9:35 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Umang Jain @ 2025-11-20 14:17 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai
  Cc: Dmitry Baryshkov, linux-sound, linux-kernel, kernel-dev,
	Umang Jain

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>
---
 sound/core/pcm_drm_eld.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/core/pcm_drm_eld.c b/sound/core/pcm_drm_eld.c
index 688eefce82fa..cb2eebaac85f 100644
--- a/sound/core/pcm_drm_eld.c
+++ b/sound/core/pcm_drm_eld.c
@@ -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;
-- 
2.51.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-11-21  9:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-20 14:17 [PATCH] ALSA: pcm: Harden the spk_alloc assumption check Umang Jain
2025-11-21  9:35 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox