VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Christoph Hellwig <hch@lst.de> 2021-07-22 09:53:54 +0200 committer: Greg Kroah-Hartman <gregkh@linuxfoundation.org> 2021-08-04 12:47:55 +0200 commit: fc553003e36191f0959e33006e17736baba0a2e2 parent: 926fa6598cddfe73877e1f2ab2cdee68cb3e79a6
Commit Summary:
block: delay freeing the gendisk
Diffstat:
1 file changed, 1 insertion, 2 deletions
diff --git a/block/genhd.c b/block/genhd.c
index ad7436bd60c1..e8968fd30b2b 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -1124,10 +1124,9 @@ static void disk_release(struct device *dev)
 	disk_release_events(disk);
 	kfree(disk->random);
 	xa_destroy(&disk->part_tbl);
-	bdput(disk->part0);
 	if (disk->queue)
 		blk_put_queue(disk->queue);
-	kfree(disk);
+	bdput(disk->part0);	/* frees the disk */
 }
 struct class block_class = {
 	.name		= "block",