[ALSA] Fix hang-up at disconnection of usb-audio
[linux-block.git] / sound / core / oss / pcm_oss.c
index 505b23ec4058c29a4407d8cd29c78e0c3509bdb1..e0821eb3d8517b2f258bb0353ebe0c10418f8b73 100644 (file)
@@ -2359,7 +2359,8 @@ static int snd_pcm_oss_release(struct inode *inode, struct file *file)
                substream = pcm_oss_file->streams[SNDRV_PCM_STREAM_CAPTURE];
        snd_assert(substream != NULL, return -ENXIO);
        pcm = substream->pcm;
-       snd_pcm_oss_sync(pcm_oss_file);
+       if (!pcm->card->shutdown)
+               snd_pcm_oss_sync(pcm_oss_file);
        mutex_lock(&pcm->open_mutex);
        snd_pcm_oss_release_file(pcm_oss_file);
        mutex_unlock(&pcm->open_mutex);