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)
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue