flash/nor: missing fileio_close.

If the file read abnormally, need to close it which was opened before.

Signed-off-by: panciyan <panciyan@eswincomputing.com>
Change-Id: I6142f154741dcd38088b7add2793219ee4dd2ae9
Reviewed-on: https://review.openocd.org/c/openocd/+/7546
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
This commit is contained in:
panciyan 2023-03-20 02:26:58 +00:00 committed by Tomas Vanek
parent b939224ab6
commit c1b14d678f
1 changed files with 1 additions and 0 deletions

View File

@ -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;
}