From 54095fc66a54ef1675c248485054ad91c1044eb1 Mon Sep 17 00:00:00 2001 From: "Ricardo M. Correia" Date: Fri, 16 Jul 2010 20:04:06 +0400 Subject: [PATCH 1/1] b=23293 Fix memory leak in lprocfs_fops_read(). i=andreas.dilger i=emoly.liu It was possible for lprocfs_fops_read() to leak a page in some circumstances. This small patch should fix it. --- lustre/obdclass/lprocfs_status.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lustre/obdclass/lprocfs_status.c b/lustre/obdclass/lprocfs_status.c index 1a83697..a253894 100644 --- a/lustre/obdclass/lprocfs_status.c +++ b/lustre/obdclass/lprocfs_status.c @@ -185,8 +185,10 @@ static ssize_t lprocfs_fops_read(struct file *f, char __user *buf, if (page == NULL) return -ENOMEM; - if (LPROCFS_ENTRY_AND_CHECK(dp)) - return -ENOENT; + if (LPROCFS_ENTRY_AND_CHECK(dp)) { + rc = -ENOENT; + goto out; + } OBD_FAIL_TIMEOUT(OBD_FAIL_LPROC_REMOVE, 10); if (dp->read_proc) -- 1.8.3.1