Message ID | 20211103174521.1426407-4-mcgrof@kernel.org (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | block: add_disk() error handling stragglers | expand |
diff --git a/drivers/nvdimm/btt.c b/drivers/nvdimm/btt.c index 416d31cda3e7..da3f007a1211 100644 --- a/drivers/nvdimm/btt.c +++ b/drivers/nvdimm/btt.c @@ -1541,7 +1541,9 @@ static int btt_blk_init(struct btt *btt) } set_capacity(btt->btt_disk, btt->nlba * btt->sector_size >> 9); - device_add_disk(&btt->nd_btt->dev, btt->btt_disk, NULL); + rc = device_add_disk(&btt->nd_btt->dev, btt->btt_disk, NULL); + if (rc) + goto out_cleanup_disk; btt->nd_btt->size = btt->nlba * (u64)btt->sector_size; nvdimm_check_and_set_ro(btt->btt_disk);