summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStar Zeng <star.zeng@intel.com>2018-02-09 10:25:12 +0800
committerStar Zeng <star.zeng@intel.com>2018-05-11 17:50:01 +0800
commit80654b7e45fe5a609b32e04aa715f64aa7686dcc (patch)
tree24cb519e1796a2462cbb319419aa78f18a38b534
parent4ebdd4432b090d9f2e79fbe97fc0943c95f1e991 (diff)
downloadedk2-80654b7e45fe5a609b32e04aa715f64aa7686dcc.tar.gz
edk2-80654b7e45fe5a609b32e04aa715f64aa7686dcc.tar.bz2
edk2-80654b7e45fe5a609b32e04aa715f64aa7686dcc.zip
SourceLevelDebugPkg DebugUsb3: Check mUsb3Instance before dereferencing it
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> (cherry picked from commit 6ef394ffe29bbc67038fc16ed540bfe6eed10e16)
-rw-r--r--SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Dxe.c2
1 files changed, 1 insertions, 1 deletions
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,