Fix coverity error in CSS SCMI driver

Change-Id: Ia7d731f429e452e4bc9f9a553d7105b6394c621c
Signed-off-by: Soby Mathew <soby.mathew@arm.com>
diff --git a/plat/arm/css/drivers/scp/css_pm_scmi.c b/plat/arm/css/drivers/scp/css_pm_scmi.c
index b4c0a7d..1ca70a2 100644
--- a/plat/arm/css/drivers/scp/css_pm_scmi.c
+++ b/plat/arm/css/drivers/scp/css_pm_scmi.c
@@ -189,7 +189,7 @@
  */
 void css_scp_on(u_register_t mpidr)
 {
-	int lvl = 0, ret;
+	int lvl = 0, ret, core_pos;
 	uint32_t scmi_pwr_state = 0;
 
 	for (; lvl <= PLAT_MAX_PWR_LVL; lvl++)
@@ -198,8 +198,11 @@
 
 	SCMI_SET_PWR_STATE_MAX_PWR_LVL(scmi_pwr_state, lvl - 1);
 
+	core_pos = plat_core_pos_by_mpidr(mpidr);
+	assert(core_pos >= 0 && core_pos < PLATFORM_CORE_COUNT);
+
 	ret = scmi_pwr_state_set(scmi_handle,
-		plat_css_core_pos_to_scmi_dmn_id_map[plat_core_pos_by_mpidr(mpidr)],
+		plat_css_core_pos_to_scmi_dmn_id_map[core_pos],
 		scmi_pwr_state);
 
 	if (ret != SCMI_E_QUEUED && ret != SCMI_E_SUCCESS) {