summaryrefslogtreecommitdiff
path: root/src/flash
diff options
context:
space:
mode:
authorAntonio Borneo <borneo.antonio@gmail.com>2010-12-31 19:18:11 +0800
committerØyvind Harboe <oyvind.harboe@zylin.com>2011-01-02 19:54:20 +0100
commit21a1c6ec33f87b6285e47ad6597cd49ad89a9485 (patch)
treef538e787ed08eff136ce89d5fc3a89fe72a3b6d7 /src/flash
parent7bb79f0f51e2c925ca99c82232e805569e9c39f2 (diff)
downloadopenocd+libswd-21a1c6ec33f87b6285e47ad6597cd49ad89a9485.tar.gz
openocd+libswd-21a1c6ec33f87b6285e47ad6597cd49ad89a9485.tar.bz2
openocd+libswd-21a1c6ec33f87b6285e47ad6597cd49ad89a9485.tar.xz
openocd+libswd-21a1c6ec33f87b6285e47ad6597cd49ad89a9485.zip
NAND/TCL: fix segfault on syntax error
Fix segfault if incomplete command "nand device dummy" is executed. Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Diffstat (limited to 'src/flash')
-rw-r--r--src/flash/nand/tcl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/flash/nand/tcl.c b/src/flash/nand/tcl.c
index af91fc89..70584fff 100644
--- a/src/flash/nand/tcl.c
+++ b/src/flash/nand/tcl.c
@@ -572,7 +572,7 @@ static COMMAND_HELPER(create_nand_device, const char *bank_name,
COMMAND_HANDLER(handle_nand_device_command)
{
- if (CMD_ARGC < 1)
+ if (CMD_ARGC < 2)
{
LOG_ERROR("incomplete nand device configuration");
return ERROR_FLASH_BANK_INVALID;