From 18014fd793d5e73eec5f2c22eaa37a32b44748eb Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Fri, 13 Nov 2015 12:51:49 +0100
Subject: [PATCH] ALSA: hda - Do zero-clear in snd_hdmi_parse_eld() itself
Git-commit: 18014fd793d5e73eec5f2c22eaa37a32b44748eb
Patch-mainline: 4.5-rc1
References: bsc#1033784

Instead of doing in each caller side, snd_hdmi_parse_eld() does
zero-clear of the parsed data by itself.  This is safer and simplifies
the upcoming code changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

---
 sound/pci/hda/hda_eld.c    |    1 +
 sound/pci/hda/patch_hdmi.c |    1 -
 2 files changed, 1 insertion(+), 1 deletion(-)

--- a/sound/pci/hda/hda_eld.c
+++ b/sound/pci/hda/hda_eld.c
@@ -253,6 +253,7 @@ int snd_hdmi_parse_eld(struct hda_codec
 	int mnl;
 	int i;
 
+	memset(e, 0, sizeof(*e));
 	e->eld_ver = GRAB_BITS(buf, 0, 3, 5);
 	if (e->eld_ver != ELD_VER_CEA_861D &&
 	    e->eld_ver != ELD_VER_PARTIAL) {
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -1573,7 +1573,6 @@ static bool hdmi_present_sense(struct hd
 						     &eld->eld_size) < 0)
 			eld->eld_valid = false;
 		else {
-			memset(&eld->info, 0, sizeof(struct parsed_hdmi_eld));
 			if (snd_hdmi_parse_eld(codec, &eld->info, eld->eld_buffer,
 						    eld->eld_size) < 0)
 				eld->eld_valid = false;
