diff options
-rw-r--r-- | sound/core/hwdep.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sound/core/hwdep.c b/sound/core/hwdep.c index a6a6ad0ad3c8..39c03f3dfbfa 100644 --- a/sound/core/hwdep.c +++ b/sound/core/hwdep.c | |||
@@ -156,15 +156,16 @@ static int snd_hwdep_release(struct inode *inode, struct file * file) | |||
156 | int err = -ENXIO; | 156 | int err = -ENXIO; |
157 | struct snd_hwdep *hw = file->private_data; | 157 | struct snd_hwdep *hw = file->private_data; |
158 | struct module *mod = hw->card->module; | 158 | struct module *mod = hw->card->module; |
159 | |||
159 | mutex_lock(&hw->open_mutex); | 160 | mutex_lock(&hw->open_mutex); |
160 | if (hw->ops.release) { | 161 | if (hw->ops.release) |
161 | err = hw->ops.release(hw, file); | 162 | err = hw->ops.release(hw, file); |
162 | wake_up(&hw->open_wait); | ||
163 | } | ||
164 | if (hw->used > 0) | 163 | if (hw->used > 0) |
165 | hw->used--; | 164 | hw->used--; |
166 | snd_card_file_remove(hw->card, file); | ||
167 | mutex_unlock(&hw->open_mutex); | 165 | mutex_unlock(&hw->open_mutex); |
166 | wake_up(&hw->open_wait); | ||
167 | |||
168 | snd_card_file_remove(hw->card, file); | ||
168 | module_put(mod); | 169 | module_put(mod); |
169 | return err; | 170 | return err; |
170 | } | 171 | } |