aboutsummaryrefslogtreecommitdiff
path: root/src/flash/nor/stm32l4x.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/flash/nor/stm32l4x.c')
-rw-r--r--src/flash/nor/stm32l4x.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/flash/nor/stm32l4x.c b/src/flash/nor/stm32l4x.c
index 9e460a2..d70895c 100644
--- a/src/flash/nor/stm32l4x.c
+++ b/src/flash/nor/stm32l4x.c
@@ -1603,7 +1603,7 @@ static int stm32l4_probe(struct flash_bank *bank)
bank->size = (flash_size_kb + gap_size_kb) * 1024;
bank->num_sectors = num_pages;
bank->sectors = malloc(sizeof(struct flash_sector) * bank->num_sectors);
- if (bank->sectors == NULL) {
+ if (!bank->sectors) {
LOG_ERROR("failed to allocate bank sectors");
return ERROR_FAIL;
}