From daaf48b96fdbbe2d89465298da18a2e20f23329a Mon Sep 17 00:00:00 2001 From: Lucien Dufour Date: Tue, 9 Dec 2025 19:04:03 +0100 Subject: [PATCH] target/armv4_5: drop goto and label Drop the jumps to the label and the label. Change-Id: I4e20684b06af09dcd749ae520e299c79ce67b467 Signed-off-by: Lucien Dufour Reviewed-on: https://review.openocd.org/c/openocd/+/9292 Reviewed-by: Antonio Borneo Tested-by: jenkins --- src/target/armv4_5.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/target/armv4_5.c b/src/target/armv4_5.c index 1b3ca0cdb..78bcc06ba 100644 --- a/src/target/armv4_5.c +++ b/src/target/armv4_5.c @@ -1638,8 +1638,10 @@ int arm_checksum_memory(struct target *target, retval = target_write_u32(target, crc_algorithm->address + i * sizeof(uint32_t), le_to_h_u32(&arm_crc_code_le[i * 4])); - if (retval != ERROR_OK) - goto cleanup; + if (retval != ERROR_OK) { + target_free_working_area(target, crc_algorithm); + return retval; + } } arm_algo.common_magic = ARM_COMMON_MAGIC; @@ -1672,7 +1674,6 @@ int arm_checksum_memory(struct target *target, destroy_reg_param(®_params[0]); destroy_reg_param(®_params[1]); -cleanup: target_free_working_area(target, crc_algorithm); return retval; @@ -1719,8 +1720,10 @@ int arm_blank_check_memory(struct target *target, check_algorithm->address + i * sizeof(uint32_t), le_to_h_u32(&check_code_le[i * 4])); - if (retval != ERROR_OK) - goto cleanup; + if (retval != ERROR_OK) { + target_free_working_area(target, check_algorithm); + return retval; + } } arm_algo.common_magic = ARM_COMMON_MAGIC; @@ -1752,7 +1755,6 @@ int arm_blank_check_memory(struct target *target, destroy_reg_param(®_params[1]); destroy_reg_param(®_params[2]); -cleanup: target_free_working_area(target, check_algorithm); if (retval != ERROR_OK)