From: Ricardo M. Correia Date: Fri, 16 Jul 2010 16:04:06 +0000 (+0400) Subject: b=23293 Fix memory leak in lprocfs_fops_read(). X-Git-Tag: 2.0.0.51~24 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=54095fc66a54ef1675c248485054ad91c1044eb1 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. --- 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)