diff --git a/casadm/cas_lib.c b/casadm/cas_lib.c index 9fe86c1..0f8f0de 100644 --- a/casadm/cas_lib.c +++ b/casadm/cas_lib.c @@ -774,6 +774,9 @@ struct cache_device *get_cache_device(const struct kcas_cache_info *info, bool b cache_size = sizeof(*cache); cache_size += info->info.core_count * sizeof(cache->cores[0]); + if (info->info.failover_detached) + return NULL; + cache = (struct cache_device *) malloc(cache_size); if (NULL == cache) { return NULL; @@ -784,9 +787,6 @@ struct cache_device *get_cache_device(const struct kcas_cache_info *info, bool b cache->id = cache_id; cache->state = info->info.state; - if (info->info.failover_detached) - return NULL; - if (strncpy_s(cache->device, sizeof(cache->device), info->cache_path_name, sizeof(info->cache_path_name))) {