Skip to content

Commit

Permalink
ALSA: hda - Add missing hda_gen_spec to struct via_spec
Browse files Browse the repository at this point in the history
The commit [4b527b6 ALSA: hda - limit internal mic boost for Asus
X202E] introduced the use of auto-parser code, but it forgot to add
struct hda_gen_spec at the head of codec->spec which the auto-parser
assumes silently.  Without this record, it may result in memory
corruption.

This patch adds the missing piece.

Cc: <stable@vger.kernel.org> [v3.5+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai committed Oct 10, 2012
1 parent 8d032a8 commit 7819d1c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sound/pci/hda/patch_via.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ enum {
};

struct via_spec {
struct hda_gen_spec gen;

/* codec parameterization */
const struct snd_kcontrol_new *mixers[6];
unsigned int num_mixers;
Expand Down Expand Up @@ -246,6 +248,7 @@ static struct via_spec * via_new_spec(struct hda_codec *codec)
/* VT1708BCE & VT1708S are almost same */
if (spec->codec_type == VT1708BCE)
spec->codec_type = VT1708S;
snd_hda_gen_init(&spec->gen);
return spec;
}

Expand Down Expand Up @@ -1627,6 +1630,7 @@ static void via_free(struct hda_codec *codec)
vt1708_stop_hp_work(spec);
kfree(spec->bind_cap_vol);
kfree(spec->bind_cap_sw);
snd_hda_gen_free(&spec->gen);
kfree(spec);
}

Expand Down

0 comments on commit 7819d1c

Please sign in to comment.