From: OpenOCD-Gerrit <ope...@us...> - 2022-10-08 07:55:15
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via d6ae732f6e1646742bb179c5247ea6a96acfc47e (commit) via d983114855eaf7ab6c63f0e5e6a553096e862a31 (commit) from 0a7e17242037431671d52c7e92f72f216c6a4c57 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit d6ae732f6e1646742bb179c5247ea6a96acfc47e Author: Daniel Anselmi <dan...@gm...> Date: Sun Oct 2 17:15:41 2022 +0200 fix leaky file-handle in virtex2 driver Change-Id: I2784a66c42be71f2982dff7746f9fb2eb1dc8ca6 Signed-off-by: Daniel Anselmi <dan...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/7243 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/pld/xilinx_bit.c b/src/pld/xilinx_bit.c index 7911b8dc1..792b3375b 100644 --- a/src/pld/xilinx_bit.c +++ b/src/pld/xilinx_bit.c @@ -96,31 +96,37 @@ int xilinx_read_bit_file(struct xilinx_bit_file *bit_file, const char *filename) read_count = fread(bit_file->unknown_header, 1, 13, input_file); if (read_count != 13) { LOG_ERROR("couldn't read unknown_header from file '%s'", filename); + fclose(input_file); return ERROR_PLD_FILE_LOAD_FAILED; } if (read_section(input_file, 2, 'a', NULL, &bit_file->source_file) != ERROR_OK) { xilinx_free_bit_file(bit_file); + fclose(input_file); return ERROR_PLD_FILE_LOAD_FAILED; } if (read_section(input_file, 2, 'b', NULL, &bit_file->part_name) != ERROR_OK) { xilinx_free_bit_file(bit_file); + fclose(input_file); return ERROR_PLD_FILE_LOAD_FAILED; } if (read_section(input_file, 2, 'c', NULL, &bit_file->date) != ERROR_OK) { xilinx_free_bit_file(bit_file); + fclose(input_file); return ERROR_PLD_FILE_LOAD_FAILED; } if (read_section(input_file, 2, 'd', NULL, &bit_file->time) != ERROR_OK) { xilinx_free_bit_file(bit_file); + fclose(input_file); return ERROR_PLD_FILE_LOAD_FAILED; } if (read_section(input_file, 4, 'e', &bit_file->length, &bit_file->data) != ERROR_OK) { xilinx_free_bit_file(bit_file); + fclose(input_file); return ERROR_PLD_FILE_LOAD_FAILED; } commit d983114855eaf7ab6c63f0e5e6a553096e862a31 Author: Daniel Anselmi <dan...@gm...> Date: Sun Oct 2 02:16:28 2022 +0200 don't return ERROR_OK in error cases Change-Id: I7e046df85838692c9044fe9c9d67e8b2c821eb0f Signed-off-by: Daniel Anselmi <dan...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/7236 Reviewed-by: Antonio Borneo <bor...@gm...> Tested-by: jenkins diff --git a/src/pld/virtex2.c b/src/pld/virtex2.c index b4861e9cb..98fd58adb 100644 --- a/src/pld/virtex2.c +++ b/src/pld/virtex2.c @@ -175,7 +175,7 @@ COMMAND_HANDLER(virtex2_handle_read_stat_command) device = get_pld_device_by_num(dev_id); if (!device) { command_print(CMD, "pld device '#%s' is out of bounds", CMD_ARGV[0]); - return ERROR_OK; + return ERROR_FAIL; } virtex2_read_stat(device, &status); @@ -197,7 +197,7 @@ PLD_DEVICE_COMMAND_HANDLER(virtex2_pld_device_command) tap = jtag_tap_by_string(CMD_ARGV[1]); if (!tap) { command_print(CMD, "Tap: %s does not exist", CMD_ARGV[1]); - return ERROR_OK; + return ERROR_FAIL; } virtex2_info = malloc(sizeof(struct virtex2_pld_device)); ----------------------------------------------------------------------- Summary of changes: src/pld/virtex2.c | 4 ++-- src/pld/xilinx_bit.c | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) hooks/post-receive -- Main OpenOCD repository |