diff options
Diffstat (limited to 'sound/core/pcm_native.c')
-rw-r--r-- | sound/core/pcm_native.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index 48c6a70ad69e..6e8872de5ba0 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c | |||
@@ -1518,6 +1518,10 @@ static int snd_pcm_drain(struct snd_pcm_substream *substream, | |||
1518 | down_read(&snd_pcm_link_rwsem); | 1518 | down_read(&snd_pcm_link_rwsem); |
1519 | snd_pcm_stream_lock_irq(substream); | 1519 | snd_pcm_stream_lock_irq(substream); |
1520 | remove_wait_queue(&to_check->sleep, &wait); | 1520 | remove_wait_queue(&to_check->sleep, &wait); |
1521 | if (card->shutdown) { | ||
1522 | result = -ENODEV; | ||
1523 | break; | ||
1524 | } | ||
1521 | if (tout == 0) { | 1525 | if (tout == 0) { |
1522 | if (substream->runtime->status->state == SNDRV_PCM_STATE_SUSPENDED) | 1526 | if (substream->runtime->status->state == SNDRV_PCM_STATE_SUSPENDED) |
1523 | result = -ESTRPIPE; | 1527 | result = -ESTRPIPE; |
@@ -2169,6 +2173,10 @@ static int snd_pcm_open(struct file *file, struct snd_pcm *pcm, int stream) | |||
2169 | mutex_unlock(&pcm->open_mutex); | 2173 | mutex_unlock(&pcm->open_mutex); |
2170 | schedule(); | 2174 | schedule(); |
2171 | mutex_lock(&pcm->open_mutex); | 2175 | mutex_lock(&pcm->open_mutex); |
2176 | if (pcm->card->shutdown) { | ||
2177 | err = -ENODEV; | ||
2178 | break; | ||
2179 | } | ||
2172 | if (signal_pending(current)) { | 2180 | if (signal_pending(current)) { |
2173 | err = -ERESTARTSYS; | 2181 | err = -ERESTARTSYS; |
2174 | break; | 2182 | break; |