]> git.sur5r.net Git - openocd/commitdiff
nand: fix return value
authorIvo Manca <pinkel@gmail.com>
Fri, 20 May 2016 08:31:03 +0000 (10:31 +0200)
committerFreddie Chopin <freddie.chopin@gmail.com>
Fri, 20 May 2016 20:35:44 +0000 (21:35 +0100)
Return ERROR_NAND_DEVICE_NOT_PROBED to prevent calling functions
from segfaulting when nand device has not yet been probed (ie nand
verify)

Change-Id: Ibc4da0aad00e6cc6c83008882b054d981453dc36
Signed-off-by: Ivo Manca <pinkel@gmail.com>
Reviewed-on: http://openocd.zylin.com/3495
Tested-by: jenkins
Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Freddie Chopin <freddie.chopin@gmail.com>
src/flash/nand/fileio.c

index 085e4af20bdcb3fd2b5e542239ee0f17ec39c69c..65474e6eed6f9fbadaca15861584eebc2eeb5c6a 100644 (file)
@@ -134,7 +134,7 @@ COMMAND_HELPER(nand_fileio_parse_args, struct nand_fileio_state *state,
 
        if (NULL == nand->device) {
                command_print(CMD_CTX, "#%s: not probed", CMD_ARGV[0]);
-               return ERROR_OK;
+               return ERROR_NAND_DEVICE_NOT_PROBED;
        }
 
        COMMAND_PARSE_NUMBER(u32, CMD_ARGV[2], state->address);