diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2015-09-01 17:28:57 +0000 |
---|---|---|
committer | abiesheuvel <abiesheuvel@Edk2> | 2015-09-01 17:28:57 +0000 |
commit | 3d175bcb6eeb0bccffd7470f0b2af82311944155 (patch) | |
tree | f5f3ef1d0c3afed4d452c02e56f07e0ab171f3e2 /ArmPlatformPkg/Library | |
parent | 3baf5c9fc94eb677d51902bf66e880c9db55cc5a (diff) | |
download | edk2-3d175bcb6eeb0bccffd7470f0b2af82311944155.tar.gz edk2-3d175bcb6eeb0bccffd7470f0b2af82311944155.tar.bz2 edk2-3d175bcb6eeb0bccffd7470f0b2af82311944155.zip |
ArmPlatformPkg/PlatformIntelBdsLib: fix and clean up error handling
InitializeConsolePipe () shadowed its own Status variable, and then
clobbered the top one before printing its error message. Instead,
use a NULL check on the LocateProtocol () output argument.
Also clean up coding style on the error path.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18376 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPlatformPkg/Library')
-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 7397047279..9ba95d9896 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));
|