commit
0bb6701685
@ -198,17 +198,12 @@ static int _cas_cls_string_ctr(struct cas_classifier *cls,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
len = strlen(data);
|
||||
len = strnlen(data, MAX_STRING_SPECIFIER_LEN);
|
||||
if (len == 0) {
|
||||
CAS_CLS_MSG(KERN_ERR, "String specifier is empty\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (len > MAX_STRING_SPECIFIER_LEN) {
|
||||
CAS_CLS_MSG(KERN_ERR, "String specifier to long: %s\n", data);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ctx = kmalloc(sizeof(*ctx), GFP_KERNEL);
|
||||
if (!ctx)
|
||||
return -ENOMEM;
|
||||
|
@ -1372,7 +1372,8 @@ int cache_mngt_prepare_cache_cfg(struct ocf_mngt_cache_config *cfg,
|
||||
uint16_t cache_id;
|
||||
bool is_part;
|
||||
|
||||
BUG_ON(!cmd);
|
||||
if (!cmd)
|
||||
return -OCF_ERR_INVAL;
|
||||
|
||||
if (strnlen(cmd->cache_path_name, MAX_STR_LEN) >= MAX_STR_LEN)
|
||||
return -OCF_ERR_INVAL;
|
||||
|
Loading…
Reference in New Issue
Block a user