At lstats_open(), calling get_proc_task() gets task struct, but it never put.
put_task_struct() should be called when releasing.
Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
return ret;
}
+static int lstats_release(struct inode *inode, struct file *file)
+{
+ struct seq_file *m = file->private_data;
+ struct task_struct *task = m->private;
+
+ put_task_struct(task);
+ return single_release(inode, file);
+}
+
static ssize_t lstats_write(struct file *file, const char __user *buf,
size_t count, loff_t *offs)
{
.read = seq_read,
.write = lstats_write,
.llseek = seq_lseek,
- .release = single_release,
+ .release = lstats_release,
};
#endif