]> Git Repo - linux.git/commitdiff
orangefs: Fix sb refcount leak when allocate sb info failed.
authorChenyuan Mi <[email protected]>
Tue, 7 Sep 2021 11:41:05 +0000 (19:41 +0800)
committerMike Marshall <[email protected]>
Mon, 11 Oct 2021 18:25:41 +0000 (14:25 -0400)
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]>
fs/orangefs/super.c

index 897fb6c3f16134fc1c49e681668c27bcd902f97d..18341cde3f34e364ee96328567db04999fc7623d 100644 (file)
@@ -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,
This page took 0.058136 seconds and 4 git commands to generate.