From: Xiao Ni Date: Thu, 12 May 2022 09:21:09 +0000 (+0800) Subject: md: fix double free of io_acct_set bioset X-Git-Tag: v6.1-rc5~1165^2~16^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=42b805af102471f53e3c7867b8c2b502ea4eef7e;p=platform%2Fkernel%2Flinux-starfive.git md: fix double free of io_acct_set bioset 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 Signed-off-by: Song Liu --- diff --git a/drivers/md/md.c b/drivers/md/md.c index 2303fbd..8273ac5e 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -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);