Skip to content

Commit 4c2b46c

Browse files
XidianGeneralhubcapsc
authored andcommitted
fs: orangefs: fix error return code of orangefs_revalidate_lookup()
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 <[email protected]> Signed-off-by: Jia-Ju Bai <[email protected]> Signed-off-by: Mike Marshall <[email protected]>
1 parent 507874c commit 4c2b46c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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)