summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJia-Ju Bai <baijiaju1990@gmail.com>2021-03-09 00:00:20 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-11-26 11:36:14 +0100
commitf6c91946c2326f8d5c4b4bcbe58c42ef4bd46cae (patch)
treea3c039694ea10d0af34f59851714e53aed2d9535 /fs
parentcc806af48ba4aa0e8641268cac95557f85a64c90 (diff)
downloadlinux-stable-f6c91946c2326f8d5c4b4bcbe58c42ef4bd46cae.tar.gz
linux-stable-f6c91946c2326f8d5c4b4bcbe58c42ef4bd46cae.tar.bz2
linux-stable-f6c91946c2326f8d5c4b4bcbe58c42ef4bd46cae.zip
fs: orangefs: fix error return code of orangefs_revalidate_lookup()
[ Upstream commit 4c2b46c824a78fc8190d8eafaaea5a9078fe7479 ] When op_alloc() returns NULL to new_op, no error return code of orangefs_revalidate_lookup() is assigned. To fix this bug, ret is assigned with -ENOMEM in this case. Fixes: 8bb8aefd5afb ("OrangeFS: Change almost all instances of the string PVFS2 to OrangeFS.") Reported-by: TOTE Robot <oslab@tsinghua.edu.cn> Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/orangefs/dcache.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/orangefs/dcache.c b/fs/orangefs/dcache.c
index fe484cf93e5c..8bbe9486e3a6 100644
--- a/fs/orangefs/dcache.c
+++ b/fs/orangefs/dcache.c
@@ -26,8 +26,10 @@ static int orangefs_revalidate_lookup(struct dentry *dentry)
gossip_debug(GOSSIP_DCACHE_DEBUG, "%s: attempting lookup.\n", __func__);
new_op = op_alloc(ORANGEFS_VFS_OP_LOOKUP);
- if (!new_op)
+ if (!new_op) {
+ ret = -ENOMEM;
goto out_put_parent;
+ }
new_op->upcall.req.lookup.sym_follow = ORANGEFS_LOOKUP_LINK_NO_FOLLOW;
new_op->upcall.req.lookup.parent_refn = parent->refn;