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

mtd: fix return in mtd_erase()

If `.erase` is implemented we must return, not execute the
fallback code path

fixes #14988
This commit is contained in:
Benjamin Valentin 2020-09-09 19:38:40 +02:00
parent 21fbf62e4e
commit 90751bcec1

View File

@ -183,7 +183,7 @@ int mtd_erase(mtd_dev_t *mtd, uint32_t addr, uint32_t count)
}
if (mtd->driver->erase) {
mtd->driver->erase(mtd, addr, count);
return mtd->driver->erase(mtd, addr, count);
}
uint32_t sector_size = mtd->pages_per_sector * mtd->page_size;