summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--spi25_statusreg.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/spi25_statusreg.c b/spi25_statusreg.c
index 01a686299..05c7acfdc 100644
--- a/spi25_statusreg.c
+++ b/spi25_statusreg.c
@@ -117,8 +117,11 @@ uint8_t spi_read_status_register(struct flashctx *flash)
/* Read Status Register */
ret = spi_send_command(flash, sizeof(cmd), sizeof(readarr), cmd, readarr);
- if (ret)
+ if (ret) {
msg_cerr("RDSR failed!\n");
+ /* FIXME: We should propagate the error. */
+ return 0;
+ }
return readarr[0];
}