From 7c0832ef7e5daca7fff363802058d01fc6da6c86 Mon Sep 17 00:00:00 2001 From: Ivo Manca Date: Fri, 20 May 2016 10:31:03 +0200 Subject: [PATCH] nand: fix return value MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Reviewed-on: http://openocd.zylin.com/3495 Tested-by: jenkins Reviewed-by: Andreas Färber Reviewed-by: Freddie Chopin --- src/flash/nand/fileio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/flash/nand/fileio.c b/src/flash/nand/fileio.c index 085e4af20b..65474e6eed 100644 --- a/src/flash/nand/fileio.c +++ b/src/flash/nand/fileio.c @@ -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); -- 2.30.2