target: fix build with jimtcl 0.79
[openocd.git] / src / target / riscv / riscv-013.c
index 006266a90c5e93190d2859013f9ed11c621e4074..2b9179d53863b09c11d37ad55f9496c9e782d2fe 100644 (file)
@@ -1199,10 +1199,7 @@ static int scratch_reserve(struct target *target,
 static int scratch_release(struct target *target,
                scratch_mem_t *scratch)
 {
-       if (scratch->area)
-               return target_free_working_area(target, scratch->area);
-
-       return ERROR_OK;
+       return target_free_working_area(target, scratch->area);
 }
 
 static int scratch_read64(struct target *target, scratch_mem_t *scratch,
@@ -2311,9 +2308,11 @@ static int init_target(struct command_context *cmd_ctx,
        generic_info->hart_count = &riscv013_hart_count;
        generic_info->data_bits = &riscv013_data_bits;
        generic_info->print_info = &riscv013_print_info;
-       generic_info->version_specific = calloc(1, sizeof(riscv013_info_t));
-       if (!generic_info->version_specific)
-               return ERROR_FAIL;
+       if (!generic_info->version_specific) {
+               generic_info->version_specific = calloc(1, sizeof(riscv013_info_t));
+               if (!generic_info->version_specific)
+                       return ERROR_FAIL;
+       }
        generic_info->sample_memory = sample_memory;
        riscv013_info_t *info = get_info(target);
 

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)