aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-roccat.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hid/hid-roccat.c')
-rw-r--r--drivers/hid/hid-roccat.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/hid/hid-roccat.c b/drivers/hid/hid-roccat.c
index e05d48edb66f..f6e80c7ca61e 100644
--- a/drivers/hid/hid-roccat.c
+++ b/drivers/hid/hid-roccat.c
@@ -168,7 +168,7 @@ static int roccat_open(struct inode *inode, struct file *file)
168 printk(KERN_EMERG "roccat device with minor %d doesn't exist\n", 168 printk(KERN_EMERG "roccat device with minor %d doesn't exist\n",
169 minor); 169 minor);
170 error = -ENODEV; 170 error = -ENODEV;
171 goto exit_unlock; 171 goto exit_err;
172 } 172 }
173 173
174 if (!device->open++) { 174 if (!device->open++) {
@@ -178,7 +178,7 @@ static int roccat_open(struct inode *inode, struct file *file)
178 PM_HINT_FULLON); 178 PM_HINT_FULLON);
179 if (error < 0) { 179 if (error < 0) {
180 --device->open; 180 --device->open;
181 goto exit_unlock; 181 goto exit_err;
182 } 182 }
183 } 183 }
184 error = device->hid->ll_driver->open(device->hid); 184 error = device->hid->ll_driver->open(device->hid);
@@ -187,7 +187,7 @@ static int roccat_open(struct inode *inode, struct file *file)
187 device->hid->ll_driver->power(device->hid, 187 device->hid->ll_driver->power(device->hid,
188 PM_HINT_NORMAL); 188 PM_HINT_NORMAL);
189 --device->open; 189 --device->open;
190 goto exit_unlock; 190 goto exit_err;
191 } 191 }
192 } 192 }
193 193
@@ -202,6 +202,9 @@ exit_unlock:
202 mutex_unlock(&device->readers_lock); 202 mutex_unlock(&device->readers_lock);
203 mutex_unlock(&devices_lock); 203 mutex_unlock(&devices_lock);
204 return error; 204 return error;
205exit_err:
206 kfree(reader);
207 goto exit_unlock;
205} 208}
206 209
207static int roccat_release(struct inode *inode, struct file *file) 210static int roccat_release(struct inode *inode, struct file *file)