From c1b14d678fd77095ef5c076c0e927aeed6a753c7 Mon Sep 17 00:00:00 2001 From: panciyan Date: Mon, 20 Mar 2023 02:26:58 +0000 Subject: [PATCH] flash/nor: missing fileio_close. If the file read abnormally, need to close it which was opened before. Signed-off-by: panciyan Change-Id: I6142f154741dcd38088b7add2793219ee4dd2ae9 Reviewed-on: https://review.openocd.org/c/openocd/+/7546 Tested-by: jenkins Reviewed-by: Tomas Vanek --- src/flash/nor/tcl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/flash/nor/tcl.c b/src/flash/nor/tcl.c index ecbcf00aa..22c1710ad 100644 --- a/src/flash/nor/tcl.c +++ b/src/flash/nor/tcl.c @@ -814,6 +814,7 @@ COMMAND_HANDLER(handle_flash_write_bank_command) if (buf_cnt != length) { LOG_ERROR("Short read"); free(buffer); + fileio_close(fileio); return ERROR_FAIL; }