aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/hwdep.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/core/hwdep.c')
-rw-r--r--sound/core/hwdep.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sound/core/hwdep.c b/sound/core/hwdep.c
index 53a6ba5ad615..3f7f6628cf7b 100644
--- a/sound/core/hwdep.c
+++ b/sound/core/hwdep.c
@@ -131,6 +131,10 @@ static int snd_hwdep_open(struct inode *inode, struct file * file)
131 mutex_unlock(&hw->open_mutex); 131 mutex_unlock(&hw->open_mutex);
132 schedule(); 132 schedule();
133 mutex_lock(&hw->open_mutex); 133 mutex_lock(&hw->open_mutex);
134 if (hw->card->shutdown) {
135 err = -ENODEV;
136 break;
137 }
134 if (signal_pending(current)) { 138 if (signal_pending(current)) {
135 err = -ERESTARTSYS; 139 err = -ERESTARTSYS;
136 break; 140 break;
@@ -462,12 +466,15 @@ static int snd_hwdep_dev_disconnect(struct snd_device *device)
462 mutex_unlock(&register_mutex); 466 mutex_unlock(&register_mutex);
463 return -EINVAL; 467 return -EINVAL;
464 } 468 }
469 mutex_lock(&hwdep->open_mutex);
470 wake_up(&hwdep->open_wait);
465#ifdef CONFIG_SND_OSSEMUL 471#ifdef CONFIG_SND_OSSEMUL
466 if (hwdep->ossreg) 472 if (hwdep->ossreg)
467 snd_unregister_oss_device(hwdep->oss_type, hwdep->card, hwdep->device); 473 snd_unregister_oss_device(hwdep->oss_type, hwdep->card, hwdep->device);
468#endif 474#endif
469 snd_unregister_device(SNDRV_DEVICE_TYPE_HWDEP, hwdep->card, hwdep->device); 475 snd_unregister_device(SNDRV_DEVICE_TYPE_HWDEP, hwdep->card, hwdep->device);
470 list_del_init(&hwdep->list); 476 list_del_init(&hwdep->list);
477 mutex_unlock(&hwdep->open_mutex);
471 mutex_unlock(&register_mutex); 478 mutex_unlock(&register_mutex);
472 return 0; 479 return 0;
473} 480}