diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-11-14 15:01:02 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-11-14 15:01:02 -0800 |
commit | ecdca043ebe8e3172e0400d0966831e2e60870a0 (patch) | |
tree | c1433e2399f544970e1f9ae7a469dbc9172c8e9f /sound/core/oss/pcm_oss.c | |
parent | bb3215e97bb1ab917ed858322a9399fb32e69e49 (diff) | |
parent | 77b67063bb6bce6d475e910d3b886a606d0d91f7 (diff) |
Merge 3.7-rc5 into driver-core-next
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) 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; @@ -2450,6 +2454,7 @@ static int snd_pcm_oss_open(struct inode *inode, struct file *file) mutex_unlock(&pcm->open_mutex); if (err < 0) goto __error; + snd_card_unref(pcm->card); return err; __error: @@ -2457,6 +2462,8 @@ static int snd_pcm_oss_open(struct inode *inode, struct file *file) __error2: snd_card_file_remove(pcm->card, file); __error1: + if (pcm) + snd_card_unref(pcm->card); return err; } |