diff options
Diffstat (limited to 'src/flash/nor/lpcspifi.c')
-rw-r--r-- | src/flash/nor/lpcspifi.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/flash/nor/lpcspifi.c b/src/flash/nor/lpcspifi.c index c99ce8d..160e2dc 100644 --- a/src/flash/nor/lpcspifi.c +++ b/src/flash/nor/lpcspifi.c @@ -66,7 +66,7 @@ FLASH_BANK_COMMAND_HANDLER(lpcspifi_flash_bank_command) return ERROR_COMMAND_SYNTAX_ERROR; lpcspifi_info = malloc(sizeof(struct lpcspifi_flash_bank)); - if (lpcspifi_info == NULL) { + if (!lpcspifi_info) { LOG_ERROR("not enough memory"); return ERROR_FAIL; } @@ -894,7 +894,7 @@ static int lpcspifi_probe(struct flash_bank *bank) /* create and fill sectors array */ bank->num_sectors = lpcspifi_info->dev->size_in_bytes / sectorsize; sectors = malloc(sizeof(struct flash_sector) * bank->num_sectors); - if (sectors == NULL) { + if (!sectors) { LOG_ERROR("not enough memory"); return ERROR_FAIL; } |