From 6ef394ffe29bbc67038fc16ed540bfe6eed10e16 Mon Sep 17 00:00:00 2001 From: Star Zeng Date: Fri, 9 Feb 2018 10:25:12 +0800 Subject: [PATCH] SourceLevelDebugPkg DebugUsb3: Check mUsb3Instance before dereferencing it Cc: Ruiyu Ni Cc: Hao Wu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng Reviewed-by: Hao Wu --- .../DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Dxe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Dxe.c b/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Dxe.c index 1582b9a8d6..29cec56f39 100644 --- a/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Dxe.c +++ b/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Dxe.c @@ -443,7 +443,7 @@ DebugCommunicationUsb3DxeConstructor ( } Done: - if (mUsb3Instance->Ready && (mUsb3Instance->PciIoEvent == 0)) { + if ((mUsb3Instance != NULL) && mUsb3Instance->Ready && (mUsb3Instance->PciIoEvent == 0)) { Status = Usb3NamedEventListen ( &gEfiPciIoProtocolGuid, TPL_NOTIFY, -- 2.39.2