From: Yufen Yu yuyufen@huawei.com
hulk inclusion category: bugfix bugzilla: 109288 CVE: NA
-------------------------------------------------
bdget_disk() will get bd_inode, so it need to do bdput().
Fixes: 3ad15d050daa ("block: take bd_mutex around delete_partitions in del_gendisk") Signed-off-by: Yufen Yu yuyufen@huawei.com Reviewed-by: Jason Yan yanaijie@huawei.com Reviewed-by: Hou Tao houtao1@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- block/genhd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/block/genhd.c b/block/genhd.c index be938088c440f..657a4cfcc62f1 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -792,8 +792,10 @@ void del_gendisk(struct gendisk *disk) delete_partition(disk, part->partno); } disk_part_iter_exit(&piter); - if (bdev) + if (bdev) { mutex_unlock(&bdev->bd_mutex); + bdput(bdev); + }
invalidate_partition(disk, 0); bdev_unhash_inode(disk_devt(disk));