Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Ming Lei and committed by
Greg Kroah-Hartman
d4062fcb 59fba744

+3
+3
drivers/usb/mon/mon_stat.c
··· 59 59 60 60 static int mon_stat_release(struct inode *inode, struct file *file) 61 61 { 62 + struct snap *sp = file->private_data; 63 + file->private_data = NULL; 64 + kfree(sp); 62 65 return 0; 63 66 } 64 67