Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 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>

authored by

Jia-Ju Bai and committed by
Mike Marshall
4c2b46c8 507874c0

+3 -1
+3 -1
fs/orangefs/dcache.c
··· 26 26 gossip_debug(GOSSIP_DCACHE_DEBUG, "%s: attempting lookup.\n", __func__); 27 27 28 28 new_op = op_alloc(ORANGEFS_VFS_OP_LOOKUP); 29 - if (!new_op) 29 + if (!new_op) { 30 + ret = -ENOMEM; 30 31 goto out_put_parent; 32 + } 31 33 32 34 new_op->upcall.req.lookup.sym_follow = ORANGEFS_LOOKUP_LINK_NO_FOLLOW; 33 35 new_op->upcall.req.lookup.parent_refn = parent->refn;