UINT8 *Image;\r
VOID *VendorCode;\r
CHAR16 *AbortReason;\r
+ EFI_FIRMWARE_MANAGEMENT_UPDATE_IMAGE_PROGRESS ProgressCallback;\r
\r
Status = gBS->HandleProtocol(\r
Handle,\r
//\r
// Before calling SetImage(), reset the progress bar to 0%\r
//\r
- UpdateImageProgress (0);\r
+ ProgressCallback = UpdateImageProgress;\r
+ Status = UpdateImageProgress (0);\r
+ if (EFI_ERROR (Status)) {\r
+ ProgressCallback = NULL;\r
+ }\r
\r
Status = Fmp->SetImage(\r
Fmp,\r
Image, // Image\r
ImageHeader->UpdateImageSize, // ImageSize\r
VendorCode, // VendorCode\r
- UpdateImageProgress, // Progress\r
+ ProgressCallback, // Progress\r
&AbortReason // AbortReason\r
);\r
//\r
// Set the progress bar to 100% after returning from SetImage()\r
//\r
- UpdateImageProgress (100);\r
+ if (ProgressCallback != NULL) {\r
+ UpdateImageProgress (100);\r
+ }\r
\r
DEBUG((DEBUG_INFO, "Fmp->SetImage - %r\n", Status));\r
if (AbortReason != NULL) {\r