]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[efi] Check the status code from AllocatePool()
authorIgnat Korchagin <ignat@cloudflare.com>
Tue, 21 Jul 2020 21:27:08 +0000 (22:27 +0100)
committerMichael Brown <mcb30@ipxe.org>
Wed, 22 Jul 2020 11:54:18 +0000 (12:54 +0100)
commitb76052335788d0ad2c4b0bded116c3b02dd4bbc2
treecf81b538095e393dc6105bcbe340fbac89ec1570
parenta08ee6e7221ea50d9096579d57674a07f3409da3
[efi] Check the status code from AllocatePool()

According to the latest UEFI specification (Version 2.8 Errata B)
p. 7.2:

  "Buffer: A pointer to a pointer to the allocated buffer if the call
   succeeds; undefined otherwise."

So implementations are obliged neither to return NULL, if the
allocation fails, nor to preserve the contents of the pointer.

Make the logic more reliable by checking the status code from
AllocatePool() instead of checking the returned pointer for NULL

Signed-off-by: Ignat Korchagin <ignat@cloudflare.com>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/interface/efi/efi_snp_hii.c