Store name for newly initialized cache in array instead of passing pointer.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
This commit is contained in:
Michal Mielewczyk 2019-08-20 01:43:11 -04:00
parent 8ed525ae7f
commit 2c27e9a433
2 changed files with 2 additions and 2 deletions

View File

@ -235,7 +235,7 @@ struct ocf_mngt_cache_config {
/**
* @brief Cache name
*/
const char *name;
char name[OCF_CACHE_NAME_SIZE];
/**
* @brief Cache mode

View File

@ -1582,7 +1582,7 @@ err_pipeline:
static int _ocf_mngt_cache_validate_cfg(struct ocf_mngt_cache_config *cfg)
{
if (!cfg->name)
if (!strnlen(cfg->name, OCF_CACHE_NAME_SIZE))
return -OCF_ERR_INVAL;
if (!ocf_cache_mode_is_valid(cfg->cache_mode))