]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - fs/nfs/nfs4namespace.c
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[linux.git] / fs / nfs / nfs4namespace.c
index 10e9e18878416d72f633656de282dd26be15e6b6..84026e7b8a5f3fe528d9f95968a2b43947b5762e 100644 (file)
@@ -137,6 +137,9 @@ static int nfs4_validate_fspath(struct dentry *dentry,
        int n;
 
        buf = kmalloc(4096, GFP_KERNEL);
+       if (!buf)
+               return -ENOMEM;
+
        path = nfs4_path(dentry, buf, 4096);
        if (IS_ERR(path)) {
                kfree(buf);
@@ -439,12 +442,11 @@ int nfs4_submount(struct fs_context *fc, struct nfs_server *server)
        struct dentry *dentry = ctx->clone_data.dentry;
        struct dentry *parent = dget_parent(dentry);
        struct inode *dir = d_inode(parent);
-       const struct qstr *name = &dentry->d_name;
        struct rpc_clnt *client;
        int ret;
 
        /* Look it up again to get its attributes and sec flavor */
-       client = nfs4_proc_lookup_mountpoint(dir, name, ctx->mntfh,
+       client = nfs4_proc_lookup_mountpoint(dir, dentry, ctx->mntfh,
                                             ctx->clone_data.fattr);
        dput(parent);
        if (IS_ERR(client))
@@ -499,7 +501,7 @@ static int nfs4_try_replacing_one_location(struct nfs_server *server,
                rpc_set_port(sap, NFS_PORT);
 
                error = -ENOMEM;
-               hostname = kstrndup(buf->data, buf->len, GFP_KERNEL);
+               hostname = kmemdup_nul(buf->data, buf->len, GFP_KERNEL);
                if (hostname == NULL)
                        break;