X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=blobdiff_plain;f=sound%2Fcore%2Fpcm_native.c;h=81a0fee0b0ba02b696a14d66835980b94f7571e9;hp=c67994d99552e01b9f756b1a657b5d6c0db73fc4;hb=38638f09259204fd9e6c6486867d8e2771ec5a4d;hpb=3b4a36722e5e518e4bdd3a215d8a1c5adc18e911 diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index c67994d99552..81a0fee0b0ba 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -1508,6 +1508,10 @@ static int snd_pcm_drain(struct snd_pcm_substream *substream, down_read(&snd_pcm_link_rwsem); snd_pcm_stream_lock_irq(substream); remove_wait_queue(&to_check->sleep, &wait); + if (card->shutdown) { + result = -ENODEV; + break; + } if (tout == 0) { if (substream->runtime->status->state == SNDRV_PCM_STATE_SUSPENDED) result = -ESTRPIPE; @@ -2153,6 +2157,10 @@ static int snd_pcm_open(struct file *file, struct snd_pcm *pcm, int stream) mutex_unlock(&pcm->open_mutex); schedule(); mutex_lock(&pcm->open_mutex); + if (pcm->card->shutdown) { + err = -ENODEV; + break; + } if (signal_pending(current)) { err = -ERESTARTSYS; break;