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://pilppa.com/gitweb/?a=commitdiff_plain;h=d4062fcb9e6164cbbcef773f6b6602e30c4b6007;p=linux-2.6-omap-h63xx.git 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 f6d1491256c..c7a595cd648 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; }