summaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_sigmatel.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-01-10 18:21:56 +0100
committerTakashi Iwai <tiwai@suse.de>2013-01-12 08:44:45 +0100
commit09b70e8509862debff5a033052f8adbd7402fa4e (patch)
tree6e67702a50a9433b198cf2d7358be3dca39fe740 /sound/pci/hda/patch_sigmatel.c
parent08fb0d0ee1b9c7aef79f54a9ae24470621eb6447 (diff)
downloadop-kernel-dev-09b70e8509862debff5a033052f8adbd7402fa4e.zip
op-kernel-dev-09b70e8509862debff5a033052f8adbd7402fa4e.tar.gz
ALSA: hda - Protect user-defined arrays via mutex
The pincfgs, init_verbs and hints set by sysfs or patch might be changed dynamically on the fly, thus we need to protect it. Add a simple protection via a mutex. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_sigmatel.c')
-rw-r--r--sound/pci/hda/patch_sigmatel.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index a86547c..d3a81f10 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -4298,15 +4298,20 @@ static void stac_toggle_power_map(struct hda_codec *codec, hda_nid_t nid,
static inline int get_int_hint(struct hda_codec *codec, const char *key,
int *valp)
{
+#ifdef CONFIG_SND_HDA_RECONFIG
const char *p;
+ mutex_lock(&codec->user_mutex);
p = snd_hda_get_hint(codec, key);
if (p) {
unsigned long val;
if (!strict_strtoul(p, 0, &val)) {
*valp = val;
+ mutex_unlock(&codec->user_mutex);
return 1;
}
}
+ mutex_unlock(&codec->user_mutex);
+#endif
return 0;
}
OpenPOWER on IntegriCloud