nvdimm/btt: do not call del_gendisk() if not needed
del_gendisk() should not called if the disk has not been added. Fix this.
Fixes: 41cd8b70c3
("libnvdimm, btt: add support for blk integrity")
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Link: https://lore.kernel.org/r/20211103165843.1402142-1-mcgrof@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
8468f45091
commit
3aefb5ee84
|
@ -1537,7 +1537,6 @@ static int btt_blk_init(struct btt *btt)
|
|||
int rc = nd_integrity_init(btt->btt_disk, btt_meta_size(btt));
|
||||
|
||||
if (rc) {
|
||||
del_gendisk(btt->btt_disk);
|
||||
blk_cleanup_disk(btt->btt_disk);
|
||||
return rc;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue