ALSA: atiixp: Fix unlocked snd_pcm_stop() call
[firefly-linux-kernel-4.4.55.git] / sound / pci / atiixp_modem.c
index d0bec7ba3b0d8f3eb610807525e071ed53c4e220..289563ecb6dd704e0a3f89d81ca19afef63cf98a 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);
 }
 
 /*
@@ -1334,7 +1336,6 @@ static int snd_atiixp_probe(struct pci_dev *pci,
 static void snd_atiixp_remove(struct pci_dev *pci)
 {
        snd_card_free(pci_get_drvdata(pci));
-       pci_set_drvdata(pci, NULL);
 }
 
 static struct pci_driver atiixp_modem_driver = {