Additional null check when starting cache instance

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
This commit is contained in:
Michal Mielewczyk 2019-12-09 06:40:48 -05:00
parent 49c87c9527
commit 3eda503095

View File

@ -1118,6 +1118,8 @@ int cache_mngt_prepare_cache_cfg(struct ocf_mngt_cache_config *cfg,
uint16_t cache_id;
bool is_part;
BUG_ON(!cmd);
if (strnlen(cmd->cache_path_name, MAX_STR_LEN) >= MAX_STR_LEN)
return -OCF_ERR_INVAL;