1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-16 18:13:49 +01:00

cpu/sam0_common/sam0_sdhc: prevent work_area double allocation

This commit is contained in:
Fabian Hüßler 2025-02-12 16:25:31 +01:00
parent 85a09681bc
commit 452f75fa3c

View File

@ -46,10 +46,12 @@ static int _init(mtd_dev_t *dev)
#if IS_USED(MODULE_MTD_WRITE_PAGE) #if IS_USED(MODULE_MTD_WRITE_PAGE)
/* TODO: move to MTD layer */ /* TODO: move to MTD layer */
if (!dev->work_area) {
dev->work_area = malloc(SD_MMC_BLOCK_SIZE); dev->work_area = malloc(SD_MMC_BLOCK_SIZE);
if (dev->work_area == NULL) { if (dev->work_area == NULL) {
return -ENOMEM; return -ENOMEM;
} }
}
dev->write_size = 1; dev->write_size = 1;
#endif #endif