diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-07-03 17:36:35 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-07-03 18:31:37 +0200 |
commit | 3fd877d32cac31292628fb8f443543fc1989b49b (patch) | |
tree | 701577fff092c38cc09b9d571b76c733c4c76b09 /sound/pci | |
parent | 257dfb410070b48e377c7894222b73ca41d662e0 (diff) | |
download | blackbird-op-linux-3fd877d32cac31292628fb8f443543fc1989b49b.tar.gz blackbird-op-linux-3fd877d32cac31292628fb8f443543fc1989b49b.zip |
ALSA: hda - Avoid possible race of beep on/off
Call cancel_work_sync() when turning off the beep switch so that the
mute call is executed in a proper order.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/hda/hda_beep.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sound/pci/hda/hda_beep.c b/sound/pci/hda/hda_beep.c index e6cf2a22c407..0bc2315b181d 100644 --- a/sound/pci/hda/hda_beep.c +++ b/sound/pci/hda/hda_beep.c @@ -165,12 +165,13 @@ static int snd_hda_do_attach(struct hda_beep *beep) int snd_hda_enable_beep_device(struct hda_codec *codec, int enable) { struct hda_beep *beep = codec->beep; - enable = !!enable; - if (beep == NULL) + if (!beep) return 0; + enable = !!enable; if (beep->enabled != enable) { beep->enabled = enable; if (!enable) { + cancel_work_sync(&beep->beep_work); /* turn off beep */ snd_hda_codec_write(beep->codec, beep->nid, 0, AC_VERB_SET_BEEP_CONTROL, 0); |