Add check for part_id in ocf_stats_collect_part_*

Signed-off-by: Michal Rakowski <michal.rakowski@intel.com>
This commit is contained in:
Michal Rakowski 2019-09-27 08:34:14 +02:00
parent 888ac74e32
commit f1cfc800e2

View File

@ -266,6 +266,9 @@ int ocf_stats_collect_part_core(ocf_core_t core, ocf_part_id_t part_id,
OCF_CHECK_NULL(core);
if (part_id > OCF_IO_CLASS_ID_MAX)
return -OCF_ERR_INVAL;
cache = ocf_core_get_cache(core);
_ocf_stats_zero(usage);
@ -291,6 +294,9 @@ int ocf_stats_collect_part_cache(ocf_cache_t cache, ocf_part_id_t part_id,
OCF_CHECK_NULL(cache);
if (part_id > OCF_IO_CLASS_ID_MAX)
return -OCF_ERR_INVAL;
_ocf_stats_zero(usage);
_ocf_stats_zero(req);
_ocf_stats_zero(blocks);