* */
if (goi->argc < 3) {
Jim_SetResult_sprintf(goi->interp, "Missing CHIP TAP OPTIONS ....");
+ free(pTap);
return JIM_ERR;
}
Jim_GetOpt_String(goi, &cp, NULL);
e = Jim_GetOpt_Nvp(goi, opts, &n);
if (e != JIM_OK) {
Jim_GetOpt_NvpUnknown(goi, opts, 0);
+ free((void *)pTap->dotted_name);
+ free(pTap);
return e;
}
LOG_DEBUG("Processing option: %s", n->name);
e = Jim_GetOpt_Wide(goi, &w);
if (e != JIM_OK) {
Jim_SetResult_sprintf(goi->interp, "option: %s bad parameter", n->name);
+ free((void *)pTap->dotted_name);
+ free(pTap);
return e;
}
new_expected_ids = malloc(sizeof(uint32_t) * (pTap->expected_ids_cnt + 1));
if (new_expected_ids == NULL) {
Jim_SetResult_sprintf(goi->interp, "no memory");
+ free((void *)pTap->dotted_name);
+ free(pTap);
return JIM_ERR;
}
e = Jim_GetOpt_Wide(goi, &w);
if (e != JIM_OK) {
Jim_SetResult_sprintf(goi->interp, "option: %s bad parameter", n->name);
+ free((void *)pTap->dotted_name);
+ free(pTap);
return e;
}
switch (n->value) {
if (is_bad_irval(pTap->ir_length, w)) {
LOG_ERROR("IR mask %x too big",
(int) w);
+ free((void *)pTap->dotted_name);
+ free(pTap);
return ERROR_FAIL;
}
pTap->ir_capture_mask = w;
if (is_bad_irval(pTap->ir_length, w)) {
LOG_ERROR("IR capture %x too big",
(int) w);
+ free((void *)pTap->dotted_name);
+ free(pTap);
return ERROR_FAIL;
}
pTap->ir_capture_value = w;
tap = jtag_tap_by_string(args[i*2]);
if (tap == NULL)
{
+ int j;
+ for (j = 0; j < i; j++)
+ free(fields[j].out_value);
+ free(fields);
command_print(cmd_ctx, "Tap: %s unknown", args[i*2]);
+
return ERROR_FAIL;
}
int field_size = tap->ir_length;
if (!etb)
{
LOG_ERROR("etb selected as etm capture driver, but no ETB configured");
+ for (i = 0; i < num_regs; i++)
+ {
+ free(reg_list[i].value);
+ }
+ free(reg_cache);
+ free(arch_info);
return ERROR_OK;
}
if (argc != 5)
{
+ free(etm_ctx);
return ERROR_COMMAND_SYNTAX_ERROR;
}
if (!target)
{
LOG_ERROR("target '%s' not defined", args[0]);
+ free(etm_ctx);
return ERROR_FAIL;
}
if (arm7_9_get_arch_pointers(target, &armv4_5, &arm7_9) != ERROR_OK)
{
command_print(cmd_ctx, "current target isn't an ARM7/ARM9 target");
+ free(etm_ctx);
return ERROR_FAIL;
}
break;
default:
command_print(cmd_ctx, "unsupported ETM port width '%s', must be 4, 8 or 16", args[1]);
+ free(etm_ctx);
return ERROR_FAIL;
}
else
{
command_print(cmd_ctx, "unsupported ETM port mode '%s', must be 'normal', 'multiplexed' or 'demultiplexed'", args[2]);
+ free(etm_ctx);
return ERROR_FAIL;
}
else
{
command_print(cmd_ctx, "unsupported ETM port clocking '%s', must be 'full' or 'half'", args[3]);
+ free(etm_ctx);
return ERROR_FAIL;
}