From d53276e407893b48ecdda2dfd9a791d57fb8fe8b Mon Sep 17 00:00:00 2001 From: "S.J.R. van Schaik" Date: Wed, 14 Jun 2017 14:38:03 +0200 Subject: [PATCH] spi: flash: the JEDEC ID should be at most three bytes in length --- source/drivers/spi_flash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/drivers/spi_flash.c b/source/drivers/spi_flash.c index 8a32e1f..bd93d54 100644 --- a/source/drivers/spi_flash.c +++ b/source/drivers/spi_flash.c @@ -52,7 +52,7 @@ static size_t spi_flash_get_jedec_id(struct flash_dev *dev, uint8_t *jedec_id, size_t len) { uint8_t cmd[1] = { SPI_FLASH_JEDEC_ID }; - uint8_t buf[6]; + uint8_t buf[3]; struct spi_dev *spi_dev = dev->priv; spi_tx_rx(spi_dev, buf, sizeof buf, cmd, sizeof cmd);