Skip to content

Commit

Permalink
ALSA: hda - Fix access-after-free in patch_realtek.c
Browse files Browse the repository at this point in the history
alc_free_kctls() has to be called after all jobs done in alc_build_controls().

Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai committed Mar 22, 2010
1 parent ea823c0 commit bae84e7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -2602,6 +2600,9 @@ static int alc_build_controls(struct hda_codec *codec)
}
}
}

alc_free_kctls(codec); /* no longer needed */

return 0;
}

Expand Down

0 comments on commit bae84e7

Please sign in to comment.