Merge pull request #58 from mmichal10/fix-cache-load

Initialize structures with 0.
This commit is contained in:
Michal Rakowski 2019-07-04 10:23:03 +02:00 committed by GitHub
commit e1055fe262
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -972,6 +972,8 @@ int cache_mngt_prepare_cache_cfg(struct ocf_mngt_cache_config *cfg,
return -OCF_ERR_INVAL;
memset(cfg, 0, sizeof(*cfg));
memset(device_cfg, 0, sizeof(*device_cfg));
memset(atomic_params, 0, sizeof(*atomic_params));
cfg->id = cmd->cache_id;
cfg->cache_mode = cmd->caching_mode;
@ -997,8 +999,9 @@ int cache_mngt_prepare_cache_cfg(struct ocf_mngt_cache_config *cfg,
init_cache = cmd->init_cache;
switch (init_cache) {
case CACHE_INIT_NEW:
case CACHE_INIT_LOAD:
device_cfg->open_cores = true;
case CACHE_INIT_NEW:
break;
default:
return -OCF_ERR_INVAL;

View File

@ -61,7 +61,7 @@ long cas_service_ioctl_ctrl(struct file *filp, unsigned int cmd,
struct kcas_start_cache *cmd_info;
struct ocf_mngt_cache_config cfg;
struct ocf_mngt_cache_device_config device_cfg;
struct atomic_dev_params atomic_params = { 0 };
struct atomic_dev_params atomic_params;
GET_CMD_INFO(cmd_info, arg);