From: Ming Lei Date: Mon, 14 Apr 2008 13:27:00 +0000 (+0800) Subject: USB: Fix memory leak in mon_stat_release X-Git-Tag: v2.6.26-rc1~1061^2~118 X-Git-Url: http://ftp.safe.ca/?a=commitdiff_plain;h=d4062fcb9e6164cbbcef773f6b6602e30c4b6007;hp=59fba744daadaaa85e07a5db96ac3618bc45a9ad;p=safe%2Fjmp%2Flinux-2.6 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 Acked-by: Pete Zaitcev Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/mon/mon_stat.c b/drivers/usb/mon/mon_stat.c index f6d1491..c7a595c 100644 --- a/drivers/usb/mon/mon_stat.c +++ b/drivers/usb/mon/mon_stat.c @@ -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; }