patch-2.1.79 linux/fs/nfs/inode.c

Next file: linux/fs/nfs/nfsroot.c
Previous file: linux/fs/nfs/dir.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.78/linux/fs/nfs/inode.c linux/fs/nfs/inode.c
@@ -138,6 +138,7 @@
 	 */
 	nfs_invalidate_dircache_sb(sb);
 
+	kfree(server->hostname);
 	sb->s_dev = 0;
 	unlock_super(sb);
 	MOD_DEC_USE_COUNT;
@@ -222,6 +223,10 @@
 	server->acregmax = data->acregmax*HZ;
 	server->acdirmin = data->acdirmin*HZ;
 	server->acdirmax = data->acdirmax*HZ;
+
+	server->hostname = kmalloc(strlen(data->hostname) + 1, GFP_KERNEL);
+	if (!server->hostname)
+		goto out_unlock;
 	strcpy(server->hostname, data->hostname);
 
 	/* Which protocol do we use? */
@@ -308,6 +313,7 @@
 
 out_no_xprt:
 	printk("NFS: cannot create RPC transport.\n");
+	kfree(server->hostname);
 out_unlock:
 	unlock_super(sb);
 	goto out_fail;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov