Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1a896231 authored by Amit Nagal's avatar Amit Nagal Committed by Jiri Kosina
Browse files

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: default avatarAmit Nagal <helloin.amit@gmail.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent ba623a77
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;

}