Skip to contentSkip to conversation

fs: orangefs: fix error return code of orangefs_revalidate_lookup()

PATCH New Jia-Ju Bai 1 participant 1 message Mar 9, 2021 Orangefs filesystem

lore
Share & tools
lore

Jia-Ju Bai

author
#0 lore raw

PATCH 1/1 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.")
---
 fs/orangefs/dcache.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
fs/orangefs/dcache.c +3 -1
index fe484cf93e5c..8bbe9486e3a6 100644
@@ -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;
Signature · 1 line
2.17.1