summaryrefslogtreecommitdiff
path: root/src/target/target.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/target/target.c')
-rw-r--r--src/target/target.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/target/target.c b/src/target/target.c
index 5fde4f8f..5805d0c7 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -533,10 +533,10 @@ int target_init(struct command_context_s *cmd_ctx)
target->type->examine = default_examine;
}
- if (target->type->init_target(cmd_ctx, target) != ERROR_OK)
+ if ((retval = target->type->init_target(cmd_ctx, target)) != ERROR_OK)
{
LOG_ERROR("target '%s' init failed", target->type->name);
- exit(-1);
+ return retval;
}
/* Set up default functions if none are provided by target */