diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2017-10-26 20:25:45 +0300 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2017-12-01 15:22:56 +0300 |
commit | 753edb131a856267ca06598be0697163dbe58a49 (patch) | |
tree | e9ee57fcb5ad20a8a16e179a8939f426f7a5f504 /lib | |
parent | 843ce54c7470c58fa7251ad07abeed67b4fc56c4 (diff) | |
download | u-boot-753edb131a856267ca06598be0697163dbe58a49.tar.xz |
efi_loader: efi_gop: check calloc return value
Calloc may return NULL. We have to check the return value.
Fixes: be8d324191f efi_loader: Add GOP support
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/efi_loader/efi_gop.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/efi_loader/efi_gop.c b/lib/efi_loader/efi_gop.c index 411a8c9226..85b5391ed1 100644 --- a/lib/efi_loader/efi_gop.c +++ b/lib/efi_loader/efi_gop.c @@ -173,6 +173,10 @@ int efi_gop_register(void) } gopobj = calloc(1, sizeof(*gopobj)); + if (!gopobj) { + printf("ERROR: Out of memory\n"); + return 1; + } /* Fill in object data */ gopobj->parent.protocols[0].guid = &efi_gop_guid; |