ALSA: hda - fix ELD memory leak
authorWu Fengguang <fengguang.wu@intel.com>
Tue, 22 Nov 2011 08:58:35 +0000 (16:58 +0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sat, 26 Nov 2011 17:08:36 +0000 (09:08 -0800)
commit46e18b7f722c2e4e9c4764774a2932debf35ece2
treeffb7d171eb72942c181c5d7e69c3b8074a993696
parent0d2c754e96311f4968e13d1f1744b7c2e2ad3442
ALSA: hda - fix ELD memory leak

Backported from commit b95d68b8179764e29558b75cec35ef4a6a98925b.

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: 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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
sound/pci/hda/hda_eld.c
sound/pci/hda/patch_hdmi.c