sunrpc: handle allocation errors from __rpc_lookup_create()
authorDan Carpenter <error27@gmail.com>
Sun, 21 Mar 2010 16:10:34 +0000 (12:10 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Mon, 22 Mar 2010 09:34:13 +0000 (05:34 -0400)
__rpc_lookup_create() can return ERR_PTR(-ENOMEM).

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: stable@kernel.org
net/sunrpc/rpc_pipe.c

index 8d63f8f..20e30c6 100644 (file)
@@ -587,6 +587,8 @@ static struct dentry *__rpc_lookup_create_exclusive(struct dentry *parent,
        struct dentry *dentry;
 
        dentry = __rpc_lookup_create(parent, name);
+       if (IS_ERR(dentry))
+               return dentry;
        if (dentry->d_inode == NULL)
                return dentry;
        dput(dentry);