diff options
Diffstat (limited to 'sound/core/oss/pcm_oss.c')
-rw-r--r-- | sound/core/oss/pcm_oss.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c index 08fde0060fd9..4c1cc51772e6 100644 --- a/sound/core/oss/pcm_oss.c +++ b/sound/core/oss/pcm_oss.c | |||
@@ -2441,6 +2441,10 @@ static int snd_pcm_oss_open(struct inode *inode, struct file *file) | |||
2441 | mutex_unlock(&pcm->open_mutex); | 2441 | mutex_unlock(&pcm->open_mutex); |
2442 | schedule(); | 2442 | schedule(); |
2443 | mutex_lock(&pcm->open_mutex); | 2443 | mutex_lock(&pcm->open_mutex); |
2444 | if (pcm->card->shutdown) { | ||
2445 | err = -ENODEV; | ||
2446 | break; | ||
2447 | } | ||
2444 | if (signal_pending(current)) { | 2448 | if (signal_pending(current)) { |
2445 | err = -ERESTARTSYS; | 2449 | err = -ERESTARTSYS; |
2446 | break; | 2450 | break; |
@@ -2450,6 +2454,7 @@ static int snd_pcm_oss_open(struct inode *inode, struct file *file) | |||
2450 | mutex_unlock(&pcm->open_mutex); | 2454 | mutex_unlock(&pcm->open_mutex); |
2451 | if (err < 0) | 2455 | if (err < 0) |
2452 | goto __error; | 2456 | goto __error; |
2457 | snd_card_unref(pcm->card); | ||
2453 | return err; | 2458 | return err; |
2454 | 2459 | ||
2455 | __error: | 2460 | __error: |
@@ -2457,6 +2462,8 @@ static int snd_pcm_oss_open(struct inode *inode, struct file *file) | |||
2457 | __error2: | 2462 | __error2: |
2458 | snd_card_file_remove(pcm->card, file); | 2463 | snd_card_file_remove(pcm->card, file); |
2459 | __error1: | 2464 | __error1: |
2465 | if (pcm) | ||
2466 | snd_card_unref(pcm->card); | ||
2460 | return err; | 2467 | return err; |
2461 | } | 2468 | } |
2462 | 2469 | ||