Skip to content

Commit ac2c637

Browse files
Chenyuan Mihubcapsc
authored andcommitted
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 <[email protected]> Signed-off-by: Xiyu Yang <[email protected]> Signed-off-by: Xin Tan <[email protected]> Signed-off-by: Mike Marshall <[email protected]>
1 parent 4c2b46c commit ac2c637

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/orangefs/super.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ struct dentry *orangefs_mount(struct file_system_type *fst,
526526
sb->s_fs_info = kzalloc(sizeof(struct orangefs_sb_info_s), GFP_KERNEL);
527527
if (!ORANGEFS_SB(sb)) {
528528
d = ERR_PTR(-ENOMEM);
529-
goto free_op;
529+
goto free_sb_and_op;
530530
}
531531

532532
ret = orangefs_fill_sb(sb,

0 commit comments

Comments
 (0)