ALSA: atiixp: Fix unlocked snd_pcm_stop() call
authorTakashi Iwai <tiwai@suse.de>
Thu, 11 Jul 2013 15:56:56 +0000 (17:56 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jul 2013 21:07:25 +0000 (14:07 -0700)
commit cc7282b8d5abbd48c81d1465925d464d9e3eaa8f upstream.

snd_pcm_stop() must be called in the PCM substream lock context.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/pci/atiixp.c
sound/pci/atiixp_modem.c

index 6e78c6789858394b16c7c4543d4c30874602c978..819430ac6b3b5238a1cf25c45198f2776664b16a 100644 (file)
@@ -689,7 +689,9 @@ static void snd_atiixp_xrun_dma(struct atiixp *chip, struct atiixp_dma *dma)
        if (! dma->substream || ! dma->running)
                return;
        snd_printdd("atiixp: XRUN detected (DMA %d)\n", dma->ops->type);
+       snd_pcm_stream_lock(dma->substream);
        snd_pcm_stop(dma->substream, SNDRV_PCM_STATE_XRUN);
+       snd_pcm_stream_unlock(dma->substream);
 }
 
 /*
index d0bec7ba3b0d8f3eb610807525e071ed53c4e220..57f41820263f6203864d3558dd128c8a16fd5c17 100644 (file)
@@ -638,7 +638,9 @@ static void snd_atiixp_xrun_dma(struct atiixp_modem *chip,
        if (! dma->substream || ! dma->running)
                return;
        snd_printdd("atiixp-modem: XRUN detected (DMA %d)\n", dma->ops->type);
+       snd_pcm_stream_lock(dma->substream);
        snd_pcm_stop(dma->substream, SNDRV_PCM_STATE_XRUN);
+       snd_pcm_stream_unlock(dma->substream);
 }
 
 /*