diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-05-09 08:35:27 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-11-28 03:03:39 -0500 |
commit | 361dab3ec2c59044f420cdf232523cd4af4e833e (patch) | |
tree | a15a6119c598e83bdb5ca45676907c6c0a3645cb /sound/pci/hda/hda_codec.c | |
parent | 04324ccc75f96b3ed7aad1c866d1b7925e977bdf (diff) |
ALSA: hda - Call snd_array_init() early and only once
This is a preliminary patch for introducing a protection to access
races of snd_array instances. Call snd_array_init() appropriately
at the initialization time and don't call it twice.
Also the allocations of codec-spec structs are cleaned up by helper
functions in patch_sigmatel.c and patch_analog.c.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_codec.c')
-rw-r--r-- | sound/pci/hda/hda_codec.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index c8f6c3bcb4f3..3634bfebc008 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -1250,6 +1250,7 @@ int /*__devinit*/ snd_hda_codec_new(struct hda_bus *bus, | |||
1250 | snd_array_init(&codec->cvt_setups, sizeof(struct hda_cvt_setup), 8); | 1250 | snd_array_init(&codec->cvt_setups, sizeof(struct hda_cvt_setup), 8); |
1251 | snd_array_init(&codec->conn_lists, sizeof(hda_nid_t), 64); | 1251 | snd_array_init(&codec->conn_lists, sizeof(hda_nid_t), 64); |
1252 | snd_array_init(&codec->spdif_out, sizeof(struct hda_spdif_out), 16); | 1252 | snd_array_init(&codec->spdif_out, sizeof(struct hda_spdif_out), 16); |
1253 | snd_array_init(&codec->jacktbl, sizeof(struct hda_jack_tbl), 16); | ||
1253 | INIT_DELAYED_WORK(&codec->jackpoll_work, hda_jackpoll_work); | 1254 | INIT_DELAYED_WORK(&codec->jackpoll_work, hda_jackpoll_work); |
1254 | 1255 | ||
1255 | #ifdef CONFIG_PM | 1256 | #ifdef CONFIG_PM |