mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-15 01:23:49 +01:00
cpu/sam0_common/sam0_sdhc: prevent work_area double allocation
This commit is contained in:
parent
85a09681bc
commit
452f75fa3c
@ -46,9 +46,11 @@ static int _init(mtd_dev_t *dev)
|
||||
|
||||
#if IS_USED(MODULE_MTD_WRITE_PAGE)
|
||||
/* TODO: move to MTD layer */
|
||||
dev->work_area = malloc(SD_MMC_BLOCK_SIZE);
|
||||
if (dev->work_area == NULL) {
|
||||
return -ENOMEM;
|
||||
if (!dev->work_area) {
|
||||
dev->work_area = malloc(SD_MMC_BLOCK_SIZE);
|
||||
if (dev->work_area == NULL) {
|
||||
return -ENOMEM;
|
||||
}
|
||||
}
|
||||
dev->write_size = 1;
|
||||
#endif
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user