mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
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 <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
This commit is contained in:
parent
ba623a774f
commit
1a8962317f
1 changed files with 2 additions and 1 deletions
|
|
@ -259,7 +259,6 @@ static int hidraw_open(struct inode *inode, struct file *file)
|
|||
|
||||
mutex_lock(&minors_lock);
|
||||
if (!hidraw_table[minor]) {
|
||||
kfree(list);
|
||||
err = -ENODEV;
|
||||
goto out_unlock;
|
||||
}
|
||||
|
|
@ -285,6 +284,8 @@ static int hidraw_open(struct inode *inode, struct file *file)
|
|||
out_unlock:
|
||||
mutex_unlock(&minors_lock);
|
||||
out:
|
||||
if (err < 0)
|
||||
kfree(list);
|
||||
return err;
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue