]> git.baikalelectronics.ru Git - uboot.git/commit
EFI: Populate descriptor_count value only when image_info_size is not zero
authorSughosh Ganu <sughosh.ganu@linaro.org>
Tue, 31 May 2022 07:15:33 +0000 (12:45 +0530)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sat, 4 Jun 2022 06:43:55 +0000 (08:43 +0200)
commit0551edcf5ca29cab16f126b8a1ddd57e06e89882
tree8cdcf5300209e5e5dd3ab243d35a6b79ddc67c43
parente2d881626b7b2772dc6aa1f4de6240a84cfa9efb
EFI: Populate descriptor_count value only when image_info_size is not zero

The GetImageInfo function of the Firmware Mangement Protocol(FMP) gets
called initially to query the size of the image descriptor array that
would have to be allocated. During this call, the rest of the function
arguments, specifically pointers might be passed as NULL. Do not
populate the descriptor_count value before it is known that the call
to GetImageInfo has been made with the allocated buffer for the image
descriptors.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
lib/efi_loader/efi_firmware.c