Pass name for newly initialized cache in array instead of pointer.
Unitl now pointer to local variable was passed to OCF and it's content could be overwriten after leaving function responsible for preparing cache config. Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
This commit is contained in:
parent
ded43cdec6
commit
56cbc6595b
@ -1051,7 +1051,7 @@ int cache_mngt_prepare_cache_cfg(struct ocf_mngt_cache_config *cfg,
|
||||
memset(device_cfg, 0, sizeof(*device_cfg));
|
||||
memset(atomic_params, 0, sizeof(*atomic_params));
|
||||
|
||||
cfg->name = cache_name;
|
||||
strncpy(cfg->name, cache_name, OCF_CACHE_NAME_SIZE);
|
||||
cfg->cache_mode = cmd->caching_mode;
|
||||
cfg->cache_line_size = cmd->line_size;
|
||||
cfg->eviction_policy = cmd->eviction_policy;
|
||||
|
@ -861,7 +861,7 @@ static int _cas_upgrade_restore_conf_main(struct cas_properties *cache_props,
|
||||
if (cache_mode >= ocf_cache_mode_max)
|
||||
cache_mode = ocf_cache_mode_default;
|
||||
|
||||
cfg.name = cache_name;
|
||||
strncpy(cfg.name, cache_name, OCF_CACHE_NAME_SIZE);
|
||||
cfg.cache_mode = cache_mode;
|
||||
/* cfg.eviction_policy = TODO */
|
||||
cfg.cache_line_size = cache_line_size;
|
||||
|
2
ocf
2
ocf
@ -1 +1 @@
|
||||
Subproject commit 8ed525ae7f9f2e8af12ff88804dd5a73d8c9fdd1
|
||||
Subproject commit 43e8905456aa0bd4fdf12c3e8aa374c641684471
|
Loading…
Reference in New Issue
Block a user