summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHouston Hoffman <hhoffman@codeaurora.org>2017-03-13 14:38:09 -0700
committerSandeep Puligilla <spuligil@codeaurora.org>2017-03-29 17:33:22 -0700
commitee7c63519ab4ff925040c6405cd7c88875de9f6f (patch)
tree8556382e73bd0afa0f14977e05553738322b6394
parent2bf576c481296ba5d2643f38b4502c6f3aff8d31 (diff)
qcacmn: simplify error handling in ce_init(1)
move ce_id_to_state assignment to the end where ce_init is guaranteed to succeed. Change-Id: I5172eb1136dde2aad915c2497ece94150c95630f CRs-Fixed: 2020794
-rw-r--r--hif/src/ce/ce_main.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/hif/src/ce/ce_main.c b/hif/src/ce/ce_main.c
index 003ed082cde4..ed70cf30a66a 100644
--- a/hif/src/ce/ce_main.c
+++ b/hif/src/ce/ce_main.c
@@ -699,7 +699,6 @@ struct CE_handle *ce_init(struct hif_softc *scn,
return NULL;
}
malloc_CE_state = true;
- scn->ce_id_to_state[CE_id] = CE_state;
qdf_spinlock_create(&CE_state->ce_index_lock);
CE_state->id = CE_id;
@@ -746,7 +745,6 @@ struct CE_handle *ce_init(struct hif_softc *scn,
HIF_ERROR("%s: src ring has no mem", __func__);
if (malloc_CE_state) {
/* allocated CE_state locally */
- scn->ce_id_to_state[CE_id] = NULL;
qdf_mem_free(CE_state);
malloc_CE_state = false;
}
@@ -899,7 +897,6 @@ struct CE_handle *ce_init(struct hif_softc *scn,
}
if (malloc_CE_state) {
/* allocated CE_state locally */
- scn->ce_id_to_state[CE_id] = NULL;
qdf_mem_free(CE_state);
malloc_CE_state = false;
}
@@ -1033,6 +1030,7 @@ struct CE_handle *ce_init(struct hif_softc *scn,
/* update the htt_data attribute */
ce_mark_datapath(CE_state);
+ scn->ce_id_to_state[CE_id] = CE_state;
return (struct CE_handle *)CE_state;