Selaa lähdekoodia

qcacmn: Array Indexing after validating 'ce_id'

Indexing array after checking 'ce_id' for boundary
condition to avoid array out of bound.

Change-Id: Iffa776021dbd70bc135152ad06cb9488a74c335f
CRs-Fixed: 3328146
Prasanna JS 2 vuotta sitten
vanhempi
sitoutus
adb0db98bc
1 muutettua tiedostoa jossa 3 lisäystä ja 1 poistoa
  1. 3 1
      hif/src/ce/ce_tasklet.c

+ 3 - 1
hif/src/ce/ce_tasklet.c

@@ -874,7 +874,7 @@ irqreturn_t ce_dispatch_interrupt(int ce_id,
 	struct HIF_CE_state *hif_ce_state = tasklet_entry->hif_ce_state;
 	struct hif_softc *scn = HIF_GET_SOFTC(hif_ce_state);
 	struct hif_opaque_softc *hif_hdl = GET_HIF_OPAQUE_HDL(scn);
-	struct CE_state *ce_state = scn->ce_id_to_state[ce_id];
+	struct CE_state *ce_state;
 
 	if (tasklet_entry->ce_id != ce_id) {
 		bool rl;
@@ -895,6 +895,8 @@ irqreturn_t ce_dispatch_interrupt(int ce_id,
 		return IRQ_NONE;
 	}
 
+	ce_state = scn->ce_id_to_state[ce_id];
+
 	ce_interrupt_lock(ce_state);
 	if (ce_check_tasklet_status(ce_id, tasklet_entry)) {
 		ce_interrupt_unlock(ce_state);