orangefs: Fix memory leak in orangefs_mount
PATCH 1/1 orangefs: Fix memory leak in orangefs_mount
In the implementation of orangefs_mount() the allocated memory for sb info should be released if op_alloc() fails. Release it via goto free_sb_and_op.
Fixes 482664ddba81 ("orangefs: add features op")
Signed-off-by Navid Emamdoost <[email protected]>
--- fs/orangefs/super.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
fs/orangefs/super.c +4 -2
@@ -566,8 +566,10 @@ struct dentry *orangefs_mount(struct file_system_type *fst,if (orangefs_userspace_version >=20906 ) { new_op =op_alloc (ORANGEFS_VFS_OP_FEATURES ); -if (!new_op) -return ERR_PTR (-ENOMEM ); +if (!new_op) { + d =ERR_PTR (-ENOMEM ); + goto free_sb_and_op; + } new_op->upcall.req.features.features =0 ; ret =service_operation (new_op,"orangefs_features" ,0 ); orangefs_features = new_op->downcall.resp.features.features;
Signature · 1 line
2.17.1