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

Commit d4062fcb authored by Ming Lei's avatar Ming Lei Committed by Greg Kroah-Hartman
Browse files

USB: Fix memory leak in mon_stat_release



Fix the leak of the snap structure allocated in mon_stat_open().

Signed-off-by: default avatarMing Lei <tom.leiming@gmail.com>
Acked-by: default avatarPete Zaitcev <zaitcev@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 59fba744
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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;
}