SourceLevelDebugPkg DebugUsb3: Check mUsb3Instance before dereferencing it
authorStar Zeng <star.zeng@intel.com>
Fri, 9 Feb 2018 02:25:12 +0000 (10:25 +0800)
committerStar Zeng <star.zeng@intel.com>
Sun, 11 Feb 2018 02:32:27 +0000 (10:32 +0800)
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Dxe.c

index 1582b9a..29cec56 100644 (file)
@@ -443,7 +443,7 @@ DebugCommunicationUsb3DxeConstructor (
   }\r
 \r
 Done:\r
-  if (mUsb3Instance->Ready && (mUsb3Instance->PciIoEvent == 0)) {\r
+  if ((mUsb3Instance != NULL) && mUsb3Instance->Ready && (mUsb3Instance->PciIoEvent == 0)) {\r
     Status = Usb3NamedEventListen (\r
                &gEfiPciIoProtocolGuid,\r
                TPL_NOTIFY,\r