Commit ea54ea53 authored by Mathias K's avatar Mathias K Committed by Øyvind Harboe
Browse files

target init sanity check

Add a test if the pointer to the target_init function in the target struct
is set before the function pointer is used.

Change-Id: Ie4ea542f64f35efce8c5bce2ced9b881bf283ec1
Signed-off-by: default avatarMathias K <>

Tested-by: jenkins
Reviewed-by: default avatarØyvind Harboe <>
parent ce3760c7
......@@ -940,6 +940,8 @@ static int target_init_one(struct command_context *cmd_ctx,
if (type->check_reset== NULL)
type->check_reset = default_check_reset;
assert(type->init_target != NULL);
int retval = type->init_target(cmd_ctx, target);
if (ERROR_OK != retval)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment