]> git.sur5r.net Git - u-boot/blobdiff - lib/efi_loader/efi_gop.c
efi_loader: efi_gop: check calloc return value
[u-boot] / lib / efi_loader / efi_gop.c
index 411a8c9226154d922ddcc948c96f1ab7660f7c23..85b5391ed1de158feef3afffa0ee0b203bb626eb 100644 (file)
@@ -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;