summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 40d46cb)
raw | patch | inline | side by side (parent: 40d46cb)
author | Justin Sobota <jsobota@ti.com> | |
Thu, 14 May 2020 20:23:46 +0000 (16:23 -0400) | ||
committer | Justin Sobota <jsobota@ti.com> | |
Thu, 14 May 2020 20:23:46 +0000 (16:23 -0400) |
Resolve critical Klocwork errors reported in
the Sciclient interrupt managements logic.
Signed-off-by: Justin Sobota <jsobota@ti.com>
the Sciclient interrupt managements logic.
Signed-off-by: Justin Sobota <jsobota@ti.com>
packages/ti/drv/sciclient/src/sciclient_rm_irq.c | patch | blob | history |
diff --git a/packages/ti/drv/sciclient/src/sciclient_rm_irq.c b/packages/ti/drv/sciclient/src/sciclient_rm_irq.c
index 3a89ffb818afa4cd966386da5f2aa5e907596d2c..44acd227d09d7b8195d76c6d45909f2e13f9126a 100755 (executable)
const struct Sciclient_rmIrqIf *cur_if;
bool cur_outp_valid, next_inp_valid;
uint32_t cur_inp;
- uint16_t cur_outp, next_inp;
- struct tisci_msg_rm_get_resource_range_req req;
- struct tisci_msg_rm_get_resource_range_resp host_resp;
- struct tisci_msg_rm_get_resource_range_resp all_resp;
+ uint16_t cur_outp = 0, next_inp = 0;
+ struct tisci_msg_rm_get_resource_range_req req = {0};
+ struct tisci_msg_rm_get_resource_range_resp host_resp = {0};
+ struct tisci_msg_rm_get_resource_range_resp all_resp = {0};
if (cfg->s_ia == SCICLIENT_RM_DEV_NONE) {
/* First node's interface must contain the source IRQ */
cur_if = cur_n->p_if[Sciclient_rmPsGetIfIdx(i)];
if (i < (Sciclient_rmPsGetPsp() - 1u)) {
next_n = Sciclient_rmPsGetIrqNode(i + 1u);
+ if (next_n == NULL) {
+ valid = false;
+ break;
+ }
}
if (i > 0u) {
SCICLIENT_SERVICE_WAIT_FOREVER);
if (r == CSL_PASS) {
ia_inst = Sciclient_rmIaGetInst(cur_n->id);
- ia_inst->vint_usage_count[cur_outp]++;
- if ((cur_outp == 0) && (cfg->vint_sb == 0)) {
- ia_inst->v0_b0_evt = cur_inp - ia_inst->sevt_offset;
+ if (ia_inst != NULL) {
+ ia_inst->vint_usage_count[cur_outp]++;
+ if ((cur_outp == 0) && (cfg->vint_sb == 0)) {
+ ia_inst->v0_b0_evt = cur_inp - ia_inst->sevt_offset;
+ }
}
}
}
SCICLIENT_SERVICE_WAIT_FOREVER);
if ((r == CSL_PASS) && (cur_outp == 0)) {
ir_inst = Sciclient_rmIrGetInst(cur_n->id);
- ir_inst->inp0_mapping = cur_outp;
+ if (ir_inst != NULL) {
+ ir_inst->inp0_mapping = cur_outp;
+ }
}
}
SCICLIENT_SERVICE_WAIT_FOREVER);
if (r == CSL_PASS) {
ia_inst = Sciclient_rmIaGetInst(cfg->s_ia);
- ia_inst->vint_usage_count[cfg->vint]++;
- if ((cfg->vint == 0) && (cfg->vint_sb == 0)) {
- ia_inst->v0_b0_evt = cfg->global_evt - ia_inst->sevt_offset;
+ if (ia_inst != NULL) {
+ ia_inst->vint_usage_count[cfg->vint]++;
+ if ((cfg->vint == 0) && (cfg->vint_sb == 0)) {
+ ia_inst->v0_b0_evt = cfg->global_evt - ia_inst->sevt_offset;
+ }
}
}
}
SCICLIENT_SERVICE_WAIT_FOREVER);
if (r == CSL_PASS) {
ia_inst = Sciclient_rmIaGetInst(cur_n->id);
- ia_inst->vint_usage_count[cur_outp]--;
- if (ia_inst->v0_b0_evt == cur_inp - ia_inst->sevt_offset) {
- ia_inst->v0_b0_evt = SCICLIENT_RM_IA_GENERIC_EVT_RESETVAL;
+ if (ia_inst != NULL) {
+ ia_inst->vint_usage_count[cur_outp]--;
+ if (ia_inst->v0_b0_evt == cur_inp - ia_inst->sevt_offset) {
+ ia_inst->v0_b0_evt = SCICLIENT_RM_IA_GENERIC_EVT_RESETVAL;
+ }
}
}
}
SCICLIENT_SERVICE_WAIT_FOREVER);
if ((r == CSL_PASS) && (cur_outp == 0)) {
ir_inst = Sciclient_rmIrGetInst(cur_n->id);
- ir_inst->inp0_mapping = SCICLIENT_RM_IR_MAPPING_FREE;
+ if (ir_inst != NULL) {
+ ir_inst->inp0_mapping = SCICLIENT_RM_IR_MAPPING_FREE;
+ }
}
}
}
SCICLIENT_SERVICE_WAIT_FOREVER);
if (r == CSL_PASS) {
ia_inst = Sciclient_rmIaGetInst(cfg->s_ia);
- ia_inst->vint_usage_count[cfg->vint]--;
- if (ia_inst->v0_b0_evt == cfg->global_evt - ia_inst->sevt_offset) {
- ia_inst->v0_b0_evt = SCICLIENT_RM_IA_GENERIC_EVT_RESETVAL;
+ if (ia_inst != NULL) {
+ ia_inst->vint_usage_count[cfg->vint]--;
+ if (ia_inst->v0_b0_evt == cfg->global_evt - ia_inst->sevt_offset) {
+ ia_inst->v0_b0_evt = SCICLIENT_RM_IA_GENERIC_EVT_RESETVAL;
+ }
}
}
}