[06/99] nfs: Fix nfs_parse_mount_options() kfree() leak

From: Greg KH
Date: Fri Nov 06 2009 - 17:47:45 EST

2.6.31-stable review patch. If anyone has any objections, please let us know.

From: Yinghai Lu <yinghai@xxxxxxxxxx>

commit 4223a4a155f245d41c350ed9eba4fc32e965c4da upstream.

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

Regression introduced in 2.6.30 by commit a67d18f (NFS: load the
rpc/rdma transport module automatically).

Reported-by: Yinghai Lu <yinghai@xxxxxxxxxx>
Reported-by: Pekka Enberg <penberg@xxxxxxxxxxxxxx>
Signed-off-by: Ingo Molnar <mingo@xxxxxxx>
Signed-off-by: Trond Myklebust <Trond.Myklebust@xxxxxxxxxx>
Signed-off-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>

fs/nfs/super.c | 1 +
1 file changed, 1 insertion(+)

--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -1323,6 +1323,7 @@ static int nfs_parse_mount_options(char
dfprintk(MOUNT, "NFS: unrecognized "
"transport protocol\n");
+ kfree(string);
return 0;

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/