[edk2] [PATCH] SourceLevelDebugPkg DebugUsb3: Check mUsb3Instance before dereferencing it

Star Zeng posted 1 patch 6 years, 10 months ago
Failed in applying to current master (apply log)
.../Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Dxe.c    | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[edk2] [PATCH] SourceLevelDebugPkg DebugUsb3: Check mUsb3Instance before dereferencing it
Posted by Star Zeng 6 years, 10 months ago
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>
---
 .../Library/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 1582b9a8d6de..29cec56f39dc 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.7.0.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH] SourceLevelDebugPkg DebugUsb3: Check mUsb3Instance before dereferencing it
Posted by Wu, Hao A 6 years, 10 months ago
Reviewed-by: Hao Wu <hao.a.wu@intel.com>

Best Regards,
Hao Wu


> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Star
> Zeng
> Sent: Friday, February 09, 2018 10:45 AM
> To: edk2-devel@lists.01.org
> Cc: Ni, Ruiyu; Wu, Hao A; Zeng, Star
> Subject: [edk2] [PATCH] 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>
> ---
>  .../Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Dxe.c
> | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git
> a/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommun
> icationLibUsb3Dxe.c
> b/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommun
> icationLibUsb3Dxe.c
> index 1582b9a8d6de..29cec56f39dc 100644
> ---
> a/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommun
> icationLibUsb3Dxe.c
> +++
> b/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommun
> icationLibUsb3Dxe.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.7.0.windows.1
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel