diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2015-08-08 12:13:19 +0200 |
---|---|---|
committer | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2015-08-11 16:07:37 +0200 |
commit | 9ac5f78e1f9aa5044c90a90d63a2abe1d6b85f18 (patch) | |
tree | 6ce30530dc09e7f39d13e67302d95b5fee810ac9 | |
parent | 62863e94b8b3818f6a3edc0c48c154c12d8e4fe1 (diff) |
ArmPlatformPkg/PlatformIntelBdsLib: fix error handling
In InitializeConsolePipe (), we clobber the Status variable in the
error handling path that reports Status in its output. Instead,
use a NULL check on the LocateProtocol () output argument.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
-rw-r--r-- | ArmPlatformPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ArmPlatformPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c b/ArmPlatformPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c index 739704727..9ba95d989 100644 --- a/ArmPlatformPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c +++ b/ArmPlatformPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c @@ -154,12 +154,12 @@ InitializeConsolePipe ( DEBUG_CODE_BEGIN();
if (EFI_ERROR(Status)) {
// We convert back to the text representation of the device Path
- EFI_DEVICE_PATH_TO_TEXT_PROTOCOL* DevicePathToTextProtocol;
- CHAR16* DevicePathTxt;
- EFI_STATUS Status;
+ EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *DevicePathToTextProtocol;
+ CHAR16 *DevicePathTxt;
- Status = gBS->LocateProtocol(&gEfiDevicePathToTextProtocolGuid, NULL, (VOID **)&DevicePathToTextProtocol);
- if (!EFI_ERROR(Status)) {
+ DevicePathToTextProtocol = NULL;
+ gBS->LocateProtocol(&gEfiDevicePathToTextProtocolGuid, NULL, (VOID **) &DevicePathToTextProtocol);
+ if (DevicePathToTextProtocol != NULL) {
DevicePathTxt = DevicePathToTextProtocol->ConvertDevicePathToText (DevicePath, TRUE, TRUE);
DEBUG((EFI_D_ERROR,"Fail to start the console with the Device Path '%s'. (Error '%r')\n", DevicePathTxt, Status));
|