projects
/
oweals
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
93945f2
)
efi_loader: efi_net: check return value of calloc
author
Heinrich Schuchardt
<xypron.glpk@gmx.de>
Thu, 26 Oct 2017 17:25:47 +0000
(19:25 +0200)
committer
Alexander Graf
<agraf@suse.de>
Fri, 1 Dec 2017 12:22:56 +0000
(13:22 +0100)
Calloc may return NULL. So we must check the return value.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
lib/efi_loader/efi_net.c
patch
|
blob
|
history
diff --git
a/lib/efi_loader/efi_net.c
b/lib/efi_loader/efi_net.c
index 432d9a99a2bf5393009064297e7bc18b3690f75e..a7b101e830b5151a2a0cea532ae52c50be4b4914 100644
(file)
--- a/
lib/efi_loader/efi_net.c
+++ b/
lib/efi_loader/efi_net.c
@@
-292,6
+292,10
@@
int efi_net_register(void)
/* We only expose the "active" eth device, so one is enough */
netobj = calloc(1, sizeof(*netobj));
+ if (!netobj) {
+ printf("ERROR: Out of memory\n");
+ return 1;
+ }
/* Fill in object data */
netobj->parent.protocols[0].guid = &efi_net_guid;