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,