From: Takashi Iwai Date: Mon, 22 Mar 2010 07:30:20 +0000 (+0100) Subject: ALSA: hda - Fix access-after-free in patch_realtek.c X-Git-Tag: v2.6.34~54^2~33 X-Git-Url: http://ftp.safe.ca/?a=commitdiff_plain;h=bae84e70d66fe46c12231082cf1c4848ea22f3ef;p=safe%2Fjmp%2Flinux-2.6 ALSA: hda - Fix access-after-free in patch_realtek.c alc_free_kctls() has to be called after all jobs done in alc_build_controls(). Signed-off-by: Takashi Iwai --- diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 4ec5763..053d53d 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -2532,8 +2532,6 @@ static int alc_build_controls(struct hda_codec *codec) return err; } - alc_free_kctls(codec); /* no longer needed */ - /* assign Capture Source enums to NID */ kctl = snd_hda_find_mixer_ctl(codec, "Capture Source"); if (!kctl) @@ -2602,6 +2600,9 @@ static int alc_build_controls(struct hda_codec *codec) } } } + + alc_free_kctls(codec); /* no longer needed */ + return 0; }