nand: fix return value

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>
This commit is contained in:
Ivo Manca 2016-05-20 10:31:03 +02:00 committed by Freddie Chopin
parent 0849dd71b1
commit 7c0832ef7e
1 changed files with 1 additions and 1 deletions

View 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);