Browse Source

sunrpc: handle allocation errors from __rpc_lookup_create()

__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
Dan Carpenter 15 years ago
parent
commit
f1f0abe192
1 changed files with 2 additions and 0 deletions
  1. 2 0
      net/sunrpc/rpc_pipe.c

+ 2 - 0
net/sunrpc/rpc_pipe.c

@@ -587,6 +587,8 @@ static struct dentry *__rpc_lookup_create_exclusive(struct dentry *parent,
 	struct dentry *dentry;
 	struct dentry *dentry;
 
 
 	dentry = __rpc_lookup_create(parent, name);
 	dentry = __rpc_lookup_create(parent, name);
+	if (IS_ERR(dentry))
+		return dentry;
 	if (dentry->d_inode == NULL)
 	if (dentry->d_inode == NULL)
 		return dentry;
 		return dentry;
 	dput(dentry);
 	dput(dentry);