|
@@ -3484,14 +3484,13 @@ static int __init dm_cache_init(void)
|
|
|
int r;
|
|
|
|
|
|
migration_cache = KMEM_CACHE(dm_cache_migration, 0);
|
|
|
- if (!migration_cache) {
|
|
|
- dm_unregister_target(&cache_target);
|
|
|
+ if (!migration_cache)
|
|
|
return -ENOMEM;
|
|
|
- }
|
|
|
|
|
|
r = dm_register_target(&cache_target);
|
|
|
if (r) {
|
|
|
DMERR("cache target registration failed: %d", r);
|
|
|
+ kmem_cache_destroy(migration_cache);
|
|
|
return r;
|
|
|
}
|
|
|
|