diff --git a/src/flash/nor/jtagspi.c b/src/flash/nor/jtagspi.c index a05ff3786..a73812d88 100644 --- a/src/flash/nor/jtagspi.c +++ b/src/flash/nor/jtagspi.c @@ -224,9 +224,10 @@ static int jtagspi_probe(struct flash_bank *bank) static void jtagspi_read_status(struct flash_bank *bank, uint32_t *status) { uint8_t buf; - jtagspi_cmd(bank, SPIFLASH_READ_STATUS, NULL, &buf, -8); - *status = buf; - /* LOG_DEBUG("status=0x%08" PRIx32, *status); */ + if (jtagspi_cmd(bank, SPIFLASH_READ_STATUS, NULL, &buf, -8) == ERROR_OK) { + *status = buf; + /* LOG_DEBUG("status=0x%08" PRIx32, *status); */ + } } static int jtagspi_wait(struct flash_bank *bank, int timeout_ms)