ALSA: hda - fix ELD memory leak
authorWu Fengguang <fengguang.wu@intel.com>
Wed, 16 Nov 2011 08:29:46 +0000 (16:29 +0800)
committerTakashi Iwai <tiwai@suse.de>
Wed, 16 Nov 2011 09:44:21 +0000 (10:44 +0100)
commitb95d68b8179764e29558b75cec35ef4a6a98925b
tree875fb72efe3cefea4df2bb37404dd32590666065
parente53de8f00c80fd1a312c95bc5157fdb98d46e070
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>
sound/pci/hda/hda_eld.c
sound/pci/hda/hda_local.h
sound/pci/hda/patch_hdmi.c