1. Initialize the local pointer 'HandleBuffer'.
2. When 'LocateHandleBuffer' return error 'HandleBuffer' is expected unchanged, add code make sure this.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19229
6f19259b-4bc3-4df7-8a09-
765794883524
}\r
\r
*PciRootBridgeIo = NULL;\r
}\r
\r
*PciRootBridgeIo = NULL;\r
Status = gBS->LocateHandleBuffer (\r
ByProtocol,\r
&gEfiPciRootBridgeIoProtocolGuid,\r
Status = gBS->LocateHandleBuffer (\r
ByProtocol,\r
&gEfiPciRootBridgeIoProtocolGuid,\r
&HandleCount,\r
&HandleBuffer\r
);\r
&HandleCount,\r
&HandleBuffer\r
);\r
- if (EFI_ERROR (Status) || (HandleCount == 0)) {\r
+ if (EFI_ERROR (Status) || (HandleCount == 0) || (HandleBuffer == NULL)) {\r