md: fix double free of io_acct_set bioset
authorXiao Ni <xni@redhat.com>
Thu, 12 May 2022 09:21:09 +0000 (17:21 +0800)
committerSong Liu <song@kernel.org>
Mon, 23 May 2022 06:07:22 +0000 (23:07 -0700)
Now io_acct_set is alloc and free in personality. Remove the codes that
free io_acct_set in md_free and md_stop.

Fixes: 0c031fd37f69 (md: Move alloc/free acct bioset in to personality)
Signed-off-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Song Liu <song@kernel.org>
drivers/md/md.c

index 2303fbd..8273ac5 100644 (file)
@@ -5585,8 +5585,6 @@ static void md_free(struct kobject *ko)
 
        bioset_exit(&mddev->bio_set);
        bioset_exit(&mddev->sync_set);
-       if (mddev->level != 1 && mddev->level != 10)
-               bioset_exit(&mddev->io_acct_set);
        kfree(mddev);
 }
 
@@ -6271,8 +6269,6 @@ void md_stop(struct mddev *mddev)
        __md_stop(mddev);
        bioset_exit(&mddev->bio_set);
        bioset_exit(&mddev->sync_set);
-       if (mddev->level != 1 && mddev->level != 10)
-               bioset_exit(&mddev->io_acct_set);
 }
 
 EXPORT_SYMBOL_GPL(md_stop);