]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
blk-cgroup: fix a hd_struct leak in blkcg_fill_root_iostats
authorChristoph Hellwig <hch@lst.de>
Sat, 14 Nov 2020 18:12:46 +0000 (19:12 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 24 Nov 2020 12:39:14 +0000 (13:39 +0100)
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 <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
block/blk-cgroup.c

index c85fbb666e40a03c84e4a687fb0fe9b2ee80af0a..5f965fabb5313e9030e50fc8322dca92786343d9 100644 (file)
@@ -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);
        }
 }