This commit is contained in:
Tomas Vanek 2025-02-26 14:46:01 +01:00 committed by GitHub
commit ae07c65754
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 3 deletions

View File

@ -711,9 +711,12 @@ static void riscv_deinit_target(struct target *target)
free(target->private_config);
struct riscv_info *info = target->arch_info;
struct target_type *tt = get_target_type(target);
if (!tt)
LOG_TARGET_ERROR(target, "Could not identify target type.");
struct target_type *tt = NULL;
if (info->dtm_version != DTM_DTMCS_VERSION_UNKNOWN) {
tt = get_target_type(target);
if (!tt)
LOG_TARGET_ERROR(target, "Could not identify target type.");
}
if (riscv_reg_flush_all(target) != ERROR_OK)
LOG_TARGET_ERROR(target, "Failed to flush registers. Ignoring this error.");