From 440c598d165f5b3977d1ec377dc7785366690356 Mon Sep 17 00:00:00 2001 From: "S.J.R. van Schaik" Date: Wed, 14 Jun 2017 14:36:36 +0200 Subject: [PATCH] spi: flash: properly copy the JEDEC ID from the buffer --- 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 fba551c..ee999dd 100644 --- a/source/drivers/spi_flash.c +++ b/source/drivers/spi_flash.c @@ -57,7 +57,7 @@ static size_t spi_flash_get_jedec_id(struct flash_dev *dev, uint8_t *jedec_id, spi_tx_rx(spi_dev, buf, sizeof buf, cmd, sizeof cmd); - memcpy(jedec_id, buf + 1, min(sizeof buf, len)); + memcpy(jedec_id, buf, min(sizeof buf, len)); return len; }