2009-10-20 05:14:11

by Trond Myklebust

[permalink] [raw]
Subject: [PATCH] nfs: Fix nfs_parse_mount_options() kfree() leak

From: Yinghai Lu <[email protected]>

Fix a (small) memory leak in one of the error paths of
the NFS mount options parsing code.

Reported-by: Yinghai Lu <[email protected]>
Reported-by: Pekka Enberg <penberg-bbCR+/[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Signed-off-by: Trond Myklebust <[email protected]>
---
Regression introduced in 2.6.30 by commit a67d18f (NFS: load the
rpc/rdma transport module automatically). Please apply to mainline
+stable...

fs/nfs/super.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index a2c18ac..90be551 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -1253,6 +1253,7 @@ static int nfs_parse_mount_options(char *raw,
default:
dfprintk(MOUNT, "NFS: unrecognized "
"transport protocol\n");
+ kfree(string);
return 0;
}
break;