mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-17 22:41:25 +00:00
USB: Fix memory leak in mon_stat_release
Fix the leak of the snap structure allocated in mon_stat_open(). Signed-off-by: Ming Lei <tom.leiming@gmail.com> Acked-by: Pete Zaitcev <zaitcev@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
59fba744da
commit
d4062fcb9e
@ -59,6 +59,9 @@ static ssize_t mon_stat_read(struct file *file, char __user *buf,
|
||||
|
||||
static int mon_stat_release(struct inode *inode, struct file *file)
|
||||
{
|
||||
struct snap *sp = file->private_data;
|
||||
file->private_data = NULL;
|
||||
kfree(sp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user