> - blk_integrity_unregister(disk); > + if (blk_get_integrity(disk)) > + blk_integrity_unregister(disk); Instead of open coding this in the callers I think we should make blk_integrity_unregister a no-op if no integrity profile was registered. Also please split this into two logically separate patches.