Merge tag 'block-5.15-2021-10-09' of git://git.kernel.dk/linux-block
[sfrench/cifs-2.6.git] / block / genhd.c
index 7b6e5e1cf95642adaa6a6fb53e902b6466d1f0f7..496e8458c3574343807bd25459bca4bfd729d0fd 100644 (file)
@@ -1268,6 +1268,7 @@ struct gendisk *__alloc_disk_node(struct request_queue *q, int node_id,
 
 out_destroy_part_tbl:
        xa_destroy(&disk->part_tbl);
+       disk->part0->bd_disk = NULL;
        iput(disk->part0->bd_inode);
 out_free_bdi:
        bdi_put(disk->bdi);