ALSA: pcm: Block the release until the system resume finishes
[sfrench/cifs-2.6.git] / sound / core / pcm_native.c
index 82f80d0c068b948e72e167533b6a0a692d82db21..11acea02bc74bbde62de8054aca81c914c13764b 100644 (file)
@@ -2799,6 +2799,10 @@ static int snd_pcm_release(struct inode *inode, struct file *file)
        if (snd_BUG_ON(!substream))
                return -ENXIO;
        pcm = substream->pcm;
+
+       /* block until the device gets woken up as it may touch the hardware */
+       snd_power_wait(pcm->card);
+
        mutex_lock(&pcm->open_mutex);
        snd_pcm_release_substream(substream);
        kfree(pcm_file);