aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_local.h
diff options
context:
space:
mode:
authorWu Fengguang <fengguang.wu@intel.com>2011-11-16 16:29:46 +0800
committerTakashi Iwai <tiwai@suse.de>2011-11-16 10:44:21 +0100
commitb95d68b8179764e29558b75cec35ef4a6a98925b (patch)
tree875fb72efe3cefea4df2bb37404dd32590666065 /sound/pci/hda/hda_local.h
parentALSA: hda/realtek: remove redundant semicolon (diff)
downloadlinux-dev-b95d68b8179764e29558b75cec35ef4a6a98925b.tar.xz
linux-dev-b95d68b8179764e29558b75cec35ef4a6a98925b.zip
ALSA: hda - fix ELD memory leak
memset(eld) clears eld->proc_entry which will leak the struct snd_info_entry when unloading module. Fix it by - memset only the fields before eld->eld_buffer - set eld->eld_valid to true _after_ all eld fields have been filled Cc: <stable@kernel.org> Cc: Pierre-louis Bossart <pierre-louis.bossart@intel.com> Acked-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_local.h')
-rw-r--r--sound/pci/hda/hda_local.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h
index 6579e0f2bb57..618ddad17236 100644
--- a/sound/pci/hda/hda_local.h
+++ b/sound/pci/hda/hda_local.h
@@ -653,6 +653,9 @@ struct hdmi_eld {
int spk_alloc;
int sad_count;
struct cea_sad sad[ELD_MAX_SAD];
+ /*
+ * all fields above eld_buffer will be cleared before updating ELD
+ */
char eld_buffer[ELD_MAX_SIZE];
#ifdef CONFIG_PROC_FS
struct snd_info_entry *proc_entry;