summaryrefslogtreecommitdiffstats
path: root/fs/orangefs
diff options
context:
space:
mode:
authorChenyuan Mi <cymi20@fudan.edu.cn>2021-09-07 13:41:05 +0200
committerMike Marshall <hubcap@omnibond.com>2021-10-11 20:25:41 +0200
commitac2c63757f4f413980d6c676dbe1ae2941b94afa (patch)
treeb5256a5990042f6da56ad93c064742b2acb4ac50 /fs/orangefs
parentfs: orangefs: fix error return code of orangefs_revalidate_lookup() (diff)
downloadlinux-ac2c63757f4f413980d6c676dbe1ae2941b94afa.tar.xz
linux-ac2c63757f4f413980d6c676dbe1ae2941b94afa.zip
orangefs: Fix sb refcount leak when allocate sb info failed.
The reference counting issue happens in one exception handling path of orangefs_mount(). When failing to allocate sb info, the function forgets to decrease the refcount of sb increased by sget(), causing a refcount leak. Fix this issue by jumping to the label "free_sb_and_op" instead of "free_op" Signed-off-by: Chenyuan Mi <cymi20@fudan.edu.cn> Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn> Signed-off-by: Xin Tan <tanxin.ctf@gmail.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
Diffstat (limited to 'fs/orangefs')
-rw-r--r--fs/orangefs/super.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/orangefs/super.c b/fs/orangefs/super.c
index 897fb6c3f161..18341cde3f34 100644
--- a/fs/orangefs/super.c
+++ b/fs/orangefs/super.c
@@ -526,7 +526,7 @@ struct dentry *orangefs_mount(struct file_system_type *fst,
sb->s_fs_info = kzalloc(sizeof(struct orangefs_sb_info_s), GFP_KERNEL);
if (!ORANGEFS_SB(sb)) {
d = ERR_PTR(-ENOMEM);
- goto free_op;
+ goto free_sb_and_op;
}
ret = orangefs_fill_sb(sb,