1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-27 15:12:36 +02:00

tree/: Make heap alloc checks err msg consistent

Change-Id: Id84a9f15c33781efc494ed36a1c7cec82a0333d6
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/69472
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Edward O'Callaghan 2022-11-12 12:05:36 +11:00 committed by Felix Singer
parent 49bcb78006
commit 4e27cad44d
2 changed files with 3 additions and 3 deletions

View File

@ -454,7 +454,7 @@ static int check_erased_range(struct flashctx *flash, unsigned int start, unsign
const uint8_t erased_value = ERASED_VALUE(flash);
if (!cmpbuf) {
msg_gerr("Could not allocate memory!\n");
msg_gerr("Out of memory!\n");
exit(1);
}
memset(cmpbuf, erased_value, len);
@ -513,7 +513,7 @@ int verify_range(struct flashctx *flash, const uint8_t *cmpbuf, unsigned int sta
uint8_t *readbuf = malloc(len);
if (!readbuf) {
msg_gerr("Could not allocate memory!\n");
msg_gerr("Out of memory!\n");
return -1;
}

View File

@ -145,7 +145,7 @@ int register_include_arg(struct layout_include_args **args, const char *arg)
tmp = malloc(sizeof(*tmp));
if (tmp == NULL) {
msg_gerr("Could not allocate memory");
msg_gerr("Out of memory");
goto error;
}