aboutsummaryrefslogtreecommitdiff
path: root/src/flash/nor/stmsmi.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/flash/nor/stmsmi.c')
-rw-r--r--src/flash/nor/stmsmi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/flash/nor/stmsmi.c b/src/flash/nor/stmsmi.c
index 662b459..553bf29 100644
--- a/src/flash/nor/stmsmi.c
+++ b/src/flash/nor/stmsmi.c
@@ -144,7 +144,7 @@ FLASH_BANK_COMMAND_HANDLER(stmsmi_flash_bank_command)
return ERROR_COMMAND_SYNTAX_ERROR;
stmsmi_info = malloc(sizeof(struct stmsmi_flash_bank));
- if (stmsmi_info == NULL) {
+ if (!stmsmi_info) {
LOG_ERROR("not enough memory");
return ERROR_FAIL;
}
@@ -600,7 +600,7 @@ static int stmsmi_probe(struct flash_bank *bank)
bank->num_sectors =
stmsmi_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;
}