Skip to content

Commit c4eb684

Browse files
XidianGeneralgregkh
authored andcommitted
fs: orangefs: fix error return code of orangefs_revalidate_lookup()
[ Upstream commit 4c2b46c ] 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: 8bb8aef ("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>
1 parent 3e7b08e commit c4eb684

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎fs/orangefs/dcache.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ static int orangefs_revalidate_lookup(struct dentry *dentry)
2626
gossip_debug(GOSSIP_DCACHE_DEBUG, "%s: attempting lookup.\n", __func__);
2727

2828
new_op = op_alloc(ORANGEFS_VFS_OP_LOOKUP);
29-
if (!new_op)
29+
if (!new_op) {
30+
ret = -ENOMEM;
3031
goto out_put_parent;
32+
}
3133

3234
new_op->upcall.req.lookup.sym_follow = ORANGEFS_LOOKUP_LINK_NO_FOLLOW;
3335
new_op->upcall.req.lookup.parent_refn = parent->refn;

0 commit comments

Comments
 (0)