Skip to content

Commit 7345801

Browse files
committed
target: do not allow 'target create' after init
A target created after init lacks target_init_one() call and is not added to gdb targets. Steps to reproduce: - start OpenOCD with a dap target - connect by telnet target create ap0.mem mem_ap -dap $_CHIPNAME.dap -ap-num 0 reset Segmentation fault is rised because target->check_reset is NULL. Change-Id: I2a62f3b450e4db3005c7041a22fb8f952e68c3b6 Signed-off-by: Tomas Vanek <[email protected]> Reviewed-on: http://openocd.zylin.com/4842 Tested-by: jenkins Reviewed-by: Antonio Borneo <[email protected]>
1 parent 877cec2 commit 7345801

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/target/target.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5882,8 +5882,7 @@ static const struct command_registration target_subcommand_handlers[] = {
58825882
},
58835883
{
58845884
.name = "create",
5885-
/* REVISIT this should be COMMAND_CONFIG ... */
5886-
.mode = COMMAND_ANY,
5885+
.mode = COMMAND_CONFIG,
58875886
.jim_handler = jim_target_create,
58885887
.usage = "name type '-chain-position' name [options ...]",
58895888
.help = "Creates and selects a new target",

0 commit comments

Comments
 (0)