diff options
author | Amit Nagal <helloin.amit@gmail.com> | 2011-09-07 07:48:47 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2011-09-07 07:48:47 -0400 |
commit | 1a8962317f494ad858971fc08ba035eff658a5c9 (patch) | |
tree | 67ef5b407e8fb04f99e05cb8af63fdeda4d4e803 /drivers/hid/hidraw.c | |
parent | ba623a774f5b529f89b3d63e0837df52e16ffb3b (diff) |
HID: hidraw: free list for all error in hidraw_open
In function hidraw_open struct hidraw_list *list should be freed for
all error conditions.
Signed-off-by: Amit Nagal <helloin.amit@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hidraw.c')
-rw-r--r-- | drivers/hid/hidraw.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c index c79578b5a788..c841a8e77339 100644 --- a/drivers/hid/hidraw.c +++ b/drivers/hid/hidraw.c | |||
@@ -259,7 +259,6 @@ static int hidraw_open(struct inode *inode, struct file *file) | |||
259 | 259 | ||
260 | mutex_lock(&minors_lock); | 260 | mutex_lock(&minors_lock); |
261 | if (!hidraw_table[minor]) { | 261 | if (!hidraw_table[minor]) { |
262 | kfree(list); | ||
263 | err = -ENODEV; | 262 | err = -ENODEV; |
264 | goto out_unlock; | 263 | goto out_unlock; |
265 | } | 264 | } |
@@ -285,6 +284,8 @@ static int hidraw_open(struct inode *inode, struct file *file) | |||
285 | out_unlock: | 284 | out_unlock: |
286 | mutex_unlock(&minors_lock); | 285 | mutex_unlock(&minors_lock); |
287 | out: | 286 | out: |
287 | if (err < 0) | ||
288 | kfree(list); | ||
288 | return err; | 289 | return err; |
289 | 290 | ||
290 | } | 291 | } |