1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

drivers/mtd_spi_nor: return error on invalid manuf id

This commit is contained in:
Francisco Molina 2020-04-14 10:52:47 +02:00
parent 1a30b8f40f
commit 8a256eba12
No known key found for this signature in database
GPG Key ID: 3E94EAC3DBDEEDA8

View File

@ -248,6 +248,11 @@ static int mtd_spi_read_jedec_id(const mtd_spi_nor_t *dev, mtd_jedec_id_t *out)
status = -2;
break;
}
if (jedec.manuf == 0xFF || jedec.manuf == 0x00) {
DEBUG_PUTS("mtd_spi_read_jedec_id: failed to read manufacturer ID");
status = -3;
break;
}
else {
/* all OK! */
break;