From: Christoph Hellwig Date: Sat, 14 Nov 2020 18:12:46 +0000 (+0100) Subject: blk-cgroup: fix a hd_struct leak in blkcg_fill_root_iostats X-Git-Tag: v5.9.11~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=52fb03b1369e53a55264a03fc1dd4eb637f3f67c;p=thirdparty%2Fkernel%2Fstable.git blk-cgroup: fix a hd_struct leak in blkcg_fill_root_iostats commit b7131ee0bac5e5df73e4098e77bbddb3a31d06ff upstream. disk_get_part needs to be paired with a disk_put_part. Cc: stable@vger.kernel.org Fixes: ef45fe470e1 ("blk-cgroup: show global disk stats in root cgroup io.stat") Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index c85fbb666e40a..5f965fabb5313 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -840,6 +840,7 @@ static void blkcg_fill_root_iostats(void) blkg_iostat_set(&blkg->iostat.cur, &tmp); u64_stats_update_end(&blkg->iostat.sync); } + disk_put_part(part); } }