diff --git a/MdeModulePkg/Core/Dxe/Hand/Handle.c b/MdeModulePkg/Core/Dxe/Hand/Handle.c index 2db441725c..86a4065733 100644 --- a/MdeModulePkg/Core/Dxe/Hand/Handle.c +++ b/MdeModulePkg/Core/Dxe/Hand/Handle.c @@ -1174,11 +1174,19 @@ Done: // except EFI_ALREADY_STARTED and EFI_UNSUPPORTED. // if (!EFI_ERROR (Status) || Status == EFI_ALREADY_STARTED) { + // + // According to above logic, if 'Prot' is NULL, then the 'Status' must be + // EFI_UNSUPPORTED. Here the 'Status' is not EFI_UNSUPPORTED, so 'Prot' + // must be not NULL. + // + // The ASSERT here is for addressing a false positive NULL pointer + // dereference issue raised from static analysis. + // + ASSERT (Prot != NULL); // // EFI_ALREADY_STARTED is not an error for bus driver. // Return the corresponding protocol interface. // - ASSERT (Prot != NULL); *Interface = Prot->Interface; } else if (Status == EFI_UNSUPPORTED) { //