mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-27 23:22:37 +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:
parent
49bcb78006
commit
4e27cad44d
@ -454,7 +454,7 @@ static int check_erased_range(struct flashctx *flash, unsigned int start, unsign
|
|||||||
const uint8_t erased_value = ERASED_VALUE(flash);
|
const uint8_t erased_value = ERASED_VALUE(flash);
|
||||||
|
|
||||||
if (!cmpbuf) {
|
if (!cmpbuf) {
|
||||||
msg_gerr("Could not allocate memory!\n");
|
msg_gerr("Out of memory!\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
memset(cmpbuf, erased_value, len);
|
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);
|
uint8_t *readbuf = malloc(len);
|
||||||
if (!readbuf) {
|
if (!readbuf) {
|
||||||
msg_gerr("Could not allocate memory!\n");
|
msg_gerr("Out of memory!\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
layout.c
2
layout.c
@ -145,7 +145,7 @@ int register_include_arg(struct layout_include_args **args, const char *arg)
|
|||||||
|
|
||||||
tmp = malloc(sizeof(*tmp));
|
tmp = malloc(sizeof(*tmp));
|
||||||
if (tmp == NULL) {
|
if (tmp == NULL) {
|
||||||
msg_gerr("Could not allocate memory");
|
msg_gerr("Out of memory");
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user