From 6cdbac82bc410e812c58d7b8acfe4b695da775c8 Mon Sep 17 00:00:00 2001 From: Michal Mielewczyk Date: Mon, 10 Jun 2019 08:23:45 -0400 Subject: [PATCH] Check for valid core_id value --- src/utils/utils_cache_line.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/utils_cache_line.c b/src/utils/utils_cache_line.c index 1d4ad33..3777aa1 100644 --- a/src/utils/utils_cache_line.c +++ b/src/utils/utils_cache_line.c @@ -22,10 +22,11 @@ static void __set_cache_line_invalid(struct ocf_cache *cache, uint8_t start_bit, uint8_t end_bit, ocf_cache_line_t line, ocf_core_id_t core_id, ocf_part_id_t part_id) { - ocf_core_t core = ocf_cache_get_core(cache, core_id); + ocf_core_t core; bool is_valid; ENV_BUG_ON(core_id >= OCF_CORE_MAX); + core = ocf_cache_get_core(cache, core_id); if (metadata_clear_valid_sec_changed(cache, line, start_bit, end_bit, &is_valid)) {