Hello!
There is trivial memleak on error exit path in nfs get_sb function.
See the patch.
Found with the help of smatch + enhanced unfree script.
Bye,
Oleg
===== fs/nfs/inode.c 1.72 vs edited =====
--- 1.72/fs/nfs/inode.c Thu Feb 13 15:57:46 2003
+++ edited/fs/nfs/inode.c Tue Mar 11 18:03:07 2003
@@ -1231,6 +1231,7 @@
if (root->size > sizeof(root->data)) {
printk("nfs_get_sb: invalid root filehandle\n");
+ kfree(server);
return ERR_PTR(-EINVAL);
}
/* We now require that the mount process passes the remote address */