[2.5] memleak in fs/nfs/inode.c::nfs_get_sb()
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 =====
fs/nfs/inode.c +1 -0
@@ -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 */