]> git.sur5r.net Git - openocd/commitdiff
NAND/TCL: fix segfault on syntax error
authorAntonio Borneo <borneo.antonio@gmail.com>
Fri, 31 Dec 2010 11:18:11 +0000 (19:18 +0800)
committerØyvind Harboe <oyvind.harboe@zylin.com>
Sun, 2 Jan 2011 18:54:20 +0000 (19:54 +0100)
Fix segfault if incomplete command "nand device dummy"
is executed.

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
src/flash/nand/tcl.c

index af91fc8924f1b450344a3ab27008eb73bcca3321..70584fff52c35b439da849b42fe78c709e79bff2 100644 (file)
@@ -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;