mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-24 13:13:57 +08:00
HID: hiddev: fix use after free in hiddev_release
There are a couple use after free bugs here. Signed-off-by: Dan Carpenter <error27@gmail.com> [jkosina@suse.cz: removed already fixed hunk] Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
parent
e23be0a27d
commit
5c699d7d3f
@ -248,12 +248,15 @@ static int hiddev_release(struct inode * inode, struct file * file)
|
||||
usbhid_close(list->hiddev->hid);
|
||||
usbhid_put_power(list->hiddev->hid);
|
||||
} else {
|
||||
mutex_unlock(&list->hiddev->existancelock);
|
||||
kfree(list->hiddev);
|
||||
kfree(list);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
kfree(list);
|
||||
mutex_unlock(&list->hiddev->existancelock);
|
||||
kfree(list);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user