Skip to content

Commit

Permalink
fs: orangefs: fix error return code of orangefs_revalidate_lookup()
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
XidianGeneral authored and hubcapsc committed Oct 11, 2021
1 parent 507874c commit 4c2b46c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/orangefs/dcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4c2b46c

Please sign in to comment.