mirror of
https://xff.cz/git/u-boot/
synced 2025-09-26 13:01:17 +02:00
efi_loader: efi_gop: check calloc return value
Calloc may return NULL. We have to check the return value.
Fixes: be8d324191
efi_loader: Add GOP support
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
committed by
Alexander Graf
parent
843ce54c74
commit
753edb131a
@@ -173,6 +173,10 @@ int efi_gop_register(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
gopobj = calloc(1, sizeof(*gopobj));
|
gopobj = calloc(1, sizeof(*gopobj));
|
||||||
|
if (!gopobj) {
|
||||||
|
printf("ERROR: Out of memory\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
/* Fill in object data */
|
/* Fill in object data */
|
||||||
gopobj->parent.protocols[0].guid = &efi_gop_guid;
|
gopobj->parent.protocols[0].guid = &efi_gop_guid;
|
||||||
|
Reference in New Issue
Block a user