diff options
author | Daniil Egranov <daniil.egranov@arm.com> | 2016-05-03 20:34:08 -0500 |
---|---|---|
committer | Ryan Harkin <ryan.harkin@linaro.org> | 2016-05-11 11:31:13 +0100 |
commit | 7359d4dddaa02aed6ec8ee0eb45e98be3a475b5e (patch) | |
tree | 623831d5576d852f627866aef0d477d3910bfb0e | |
parent | 77835cbe30a36cdd3c6611a320eda8756efc78c3 (diff) |
IntelFrameworkModulePkg/GenericBdsLib: Check for invalid device handle
Added error control for invalid device handle when LocateDevicePath()
fails.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daniil Egranov <daniil.egranov@arm.com>
-rw-r--r-- | IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c b/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c index 68b32f32f0..330d6b516c 100644 --- a/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c +++ b/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c @@ -3626,7 +3626,11 @@ BdsLibGetBootableHandle ( //
UpdatedDevicePath = DevicePath;
Status = gBS->LocateDevicePath (&gEfiDevicePathProtocolGuid, &UpdatedDevicePath, &Handle);
- gBS->ConnectController (Handle, NULL, NULL, TRUE);
+ if (!EFI_ERROR (Status)) { + gBS->ConnectController (Handle, NULL, NULL, TRUE); + } else { + return (EFI_HANDLE) NULL; + } }
} else {
//
|