sunrpc: handle allocation errors from __rpc_lookup_create()
authorDan Carpenter <[email protected]>
Sun, 21 Mar 2010 16:10:34 +0000 (12:10 -0400)
committerTrond Myklebust <[email protected]>
Mon, 22 Mar 2010 09:34:13 +0000 (05:34 -0400)
__rpc_lookup_create() can return ERR_PTR(-ENOMEM).

Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Trond Myklebust <[email protected]>
Cc: [email protected]
net/sunrpc/rpc_pipe.c

index 8d63f8fd29b7e3ff0e940d7457d45203f99c56b1..20e30c6f8355dc0bc612bffb44abefee7c3536df 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);