diff --git a/fs/nfs/nfs4namespace.c b/fs/nfs/nfs4namespace.c index 10e9e1887841..de6875a9b391 100644 --- a/fs/nfs/nfs4namespace.c +++ b/fs/nfs/nfs4namespace.c @@ -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);