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:
parent
8ed525ae7f
commit
2c27e9a433
@ -235,7 +235,7 @@ struct ocf_mngt_cache_config {
|
|||||||
/**
|
/**
|
||||||
* @brief Cache name
|
* @brief Cache name
|
||||||
*/
|
*/
|
||||||
const char *name;
|
char name[OCF_CACHE_NAME_SIZE];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Cache mode
|
* @brief Cache mode
|
||||||
|
@ -1582,7 +1582,7 @@ err_pipeline:
|
|||||||
|
|
||||||
static int _ocf_mngt_cache_validate_cfg(struct ocf_mngt_cache_config *cfg)
|
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;
|
return -OCF_ERR_INVAL;
|
||||||
|
|
||||||
if (!ocf_cache_mode_is_valid(cfg->cache_mode))
|
if (!ocf_cache_mode_is_valid(cfg->cache_mode))
|
||||||
|
Loading…
Reference in New Issue
Block a user