Skip to contentSkip to conversation

ALSA: hda - Add missing hda_gen_spec to struct via_spec

PATCH In review Takashi Iwai 2 participants 3 messages Oct 10, 2012 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: hda - Add missing hda_gen_spec to struct via_spec

The commit [4b527b65 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.

---

David, I queued this fix now. I'm going to send a pull request tomorrow or on Friday.

 sound/pci/hda/patch_via.c | 4 ++++
 1 file changed, 4 insertions(+)
sound/pci/hda/patch_via.c +4 -0
index eae466a..72a2f60 100644
@@ -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;
@@ -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;
 }
 
@@ -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);
 }
 
Signature · 1 line
1.7.12.2
#1 lore raw
Quoted 6 lines · Takashi Iwai

The commit [4b527b65 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.

Quoted 8 lines

This patch adds the missing piece.

---

David, I queued this fix now. I'm going to send a pull request tomorrow or on Friday.

Thanks for catching. Isn't patch_sigmatel.c missing one also?

Signature · 2 lines
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic
#2 lore raw

At Wed, 10 Oct 2012 09:30:36 +0200,

Quoted 10 lines · David Henningsson
Quoted 8 lines · Takashi Iwai

The commit [4b527b65 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.

Quoted 8 lines
Quoted 6 lines

---

David, I queued this fix now. I'm going to send a pull request tomorrow or on Friday.

Thanks for catching. Isn't patch_sigmatel.c missing one also?

No, patch_sigmatel.c doesn't use the generic fixup code yet.

Takashi