Skip to contentSkip to conversation

block: remove blk_free_devt in add_partition

PATCH In review weiping zhang 3 participants 4 messages Aug 18, 2017 – Aug 24, 2017 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block: remove blk_free_devt in add_partition

put_device(pdev) will call pdev->type->release finally, and blk_free_devt has been called in part_release(), so remove it.

---
 block/partition-generic.c | 1 -
 1 file changed, 1 deletion(-)
block/partition-generic.c +0 -1
index c5ec824..04d82dd 100644
@@ -391,7 +391,6 @@ struct hd_struct *add_partition(struct gendisk *disk, int partno,
 	device_del(pdev);
 out_put:
 	put_device(pdev);
-	blk_free_devt(devt);
 	return ERR_PTR(err);
 }
 
Signature · 1 line
2.9.4
#1 lore raw
Quoted 23 lines · weiping zhang

put_device(pdev) will call pdev->type->release finally, and blk_free_devt has been called in part_release(), so remove it.

---
 block/partition-generic.c | 1 -
 1 file changed, 1 deletion(-)
block/partition-generic.c +0 -1
index c5ec824..04d82dd 100644
@@ -391,7 +391,6 @@ struct hd_struct *add_partition(struct gendisk *disk, int partno,
 	device_del(pdev);
 out_put:
 	put_device(pdev);
-	blk_free_devt(devt);
 	return ERR_PTR(err);
 }
 
Signature · 1 line
2.9.4

Hi Jens,

would you please look this trivial patch at your convenience?

Thanks

maintainer
#2 lore raw
In reply to weiping zhang
Quoted 2 lines · weiping zhang

put_device(pdev) will call pdev->type->release finally, and blk_free_devt has been called in part_release(), so remove it.

Your analysis looks correct to me, applied for 4.14.

Signature · 1 line
Jens Axboe
#3 lore raw
Quoted 11 lines · Jens Axboe <[email protected]>于2017年8月24日 周四22:27写道:
Quoted 2 lines · weiping zhang

put_device(pdev) will call pdev->type->release finally, and blk_free_devt has been called in part_release(), so remove it.

Your analysis looks correct to me, applied for 4.14.

--
Jens Axboe

Thanks a ton