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.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sound/core/hwdep.c b/sound/core/hwdep.c
index 75ea16f35b1a..53a6ba5ad615 100644
--- a/sound/core/hwdep.c
+++ b/sound/core/hwdep.c
@@ -100,8 +100,10 @@ static int snd_hwdep_open(struct inode *inode, struct file * file)
100 if (hw == NULL) 100 if (hw == NULL)
101 return -ENODEV; 101 return -ENODEV;
102 102
103 if (!try_module_get(hw->card->module)) 103 if (!try_module_get(hw->card->module)) {
104 snd_card_unref(hw->card);
104 return -EFAULT; 105 return -EFAULT;
106 }
105 107
106 init_waitqueue_entry(&wait, current); 108 init_waitqueue_entry(&wait, current);
107 add_wait_queue(&hw->open_wait, &wait); 109 add_wait_queue(&hw->open_wait, &wait);
@@ -148,6 +150,7 @@ static int snd_hwdep_open(struct inode *inode, struct file * file)
148 mutex_unlock(&hw->open_mutex); 150 mutex_unlock(&hw->open_mutex);
149 if (err < 0) 151 if (err < 0)
150 module_put(hw->card->module); 152 module_put(hw->card->module);
153 snd_card_unref(hw->card);
151 return err; 154 return err;
152} 155}
153 156