fix: ASSERT on firmware update when capsule not found. (#2079)
Commit 74e12f7
introduced a case where FreePool could be called with an
unallocated pointer if no capsule image is found.
Signed-off-by: Bejean Mosher <bejean.mosher@intel.com>
This commit is contained in:
parent
94ae656ba1
commit
16d855db39
|
@ -1394,6 +1394,7 @@ InitFirmwareUpdate (
|
|||
FwUpdStatusOffset = PcdGet32(PcdFwUpdStatusBase);
|
||||
ResetRequired = FALSE;
|
||||
FwPolicy.Data = 0;
|
||||
CapsuleImage = NULL;
|
||||
|
||||
//
|
||||
// Get capsule image.
|
||||
|
@ -1452,7 +1453,9 @@ InitFirmwareUpdate (
|
|||
if (EFI_ERROR (Status)) {
|
||||
//
|
||||
// Error condition
|
||||
FreePool(CapsuleImage);
|
||||
if (CapsuleImage != NULL) {
|
||||
FreePool(CapsuleImage);
|
||||
}
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue