From d4062fcb9e6164cbbcef773f6b6602e30c4b6007 Mon Sep 17 00:00:00 2001 From: Ming Lei Date: Mon, 14 Apr 2008 21:27:00 +0800 Subject: [PATCH] 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 --- drivers/usb/mon/mon_stat.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/mon/mon_stat.c b/drivers/usb/mon/mon_stat.c index f6d1491256c4..c7a595cd648a 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; } -- 2.20.1