From: Dan Carpenter Date: Sun, 21 Mar 2010 16:10:34 +0000 (-0400) Subject: sunrpc: handle allocation errors from __rpc_lookup_create() X-Git-Tag: firefly_0821_release~10186^2~1952 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a420c0a1ec9d34fa8923f59e12d4ad9047db490b;p=firefly-linux-kernel-4.4.55.git sunrpc: handle allocation errors from __rpc_lookup_create() commit f1f0abe192a72e75d7c59972e30784d043fd8d73 upstream. __rpc_lookup_create() can return ERR_PTR(-ENOMEM). Signed-off-by: Dan Carpenter Signed-off-by: Trond Myklebust Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c index 49278f830367..27a23785a50d 100644 --- a/net/sunrpc/rpc_pipe.c +++ b/net/sunrpc/rpc_pipe.c @@ -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);