summaryrefslogtreecommitdiffstats
path: root/spi25.c
diff options
context:
space:
mode:
Diffstat (limited to 'spi25.c')
-rw-r--r--spi25.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/spi25.c b/spi25.c
index c774f9917..16d7f1b1d 100644
--- a/spi25.c
+++ b/spi25.c
@@ -570,6 +570,8 @@ static int spi_write_cmd(struct flashctx *const flash, const uint8_t op,
msg_cerr("%s called for too long a write\n", __func__);
return 1;
}
+ if (!out_bytes && out_len > 0)
+ return 1;
memcpy(cmd + 1 + addr_len, out_bytes, out_len);
cmds[1].writecnt = 1 + addr_len + out_len;