flash/nor/fespi: check target type

Change-Id: I09d3ed20966b37ec63c09c2ffb0e0403986cb1e5
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/7001
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Tim Newsome <tim@sifive.com>
This commit is contained in:
Tomas Vanek 2022-05-26 13:51:18 +02:00
parent 1d8bc131a6
commit a895b3b4f8
1 changed files with 6 additions and 0 deletions

View File

@ -512,6 +512,12 @@ static int fespi_write(struct flash_bank *bank, const uint8_t *buffer,
}
}
struct riscv_info *riscv = riscv_info(target);
if (!is_riscv(riscv)) {
LOG_ERROR("Unexpected target type");
return ERROR_FAIL;
}
unsigned int xlen = riscv_xlen(target);
struct working_area *algorithm_wa = NULL;
struct working_area *data_wa = NULL;