diff mbox series

[5.9,244/252] blk-cgroup: fix a hd_struct leak in blkcg_fill_root_iostats

Message ID 20201123121847.356844127@linuxfoundation.org
State New
Headers show
Series None | expand

Commit Message

Greg KH Nov. 23, 2020, 12:23 p.m. UTC
From: Christoph Hellwig <hch@lst.de>

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 |    1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

--- 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);
 	}
 }