Skip to contentSkip to conversation

blk-cgroup: fix a hd_struct leak in blkcg_fill_root_iostats

PATCH Applied Christoph Hellwig 2 participants 2 messages Nov 14, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 blk-cgroup: fix a hd_struct leak in blkcg_fill_root_iostats

disk_get_part needs to be paired with a disk_put_part.

Fixes ef45fe470e1 ("blk-cgroup: show global disk stats in root cgroup io.stat")
---
 block/blk-cgroup.c | 1 +
 1 file changed, 1 insertion(+)
block/blk-cgroup.c +1 -0
index c68bdf58c9a6e1..54fbe1e80cc41a 100644
@@ -849,6 +849,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);
 	}
 }
 
Signature · 1 line
2.28.0
maintainer Applied
#1 lore raw
Quoted 1 line · Christoph Hellwig

disk_get_part needs to be paired with a disk_put_part.

Applied, thanks.

Signature · 1 line
Jens Axboe