audk/MdeModulePkg
Ranbir Singh dd49d448b0 MdeModulePkg/Bus/Pci/EhciDxe: Fix FORWARD_NULL Coverity issues
The function UsbHcGetPciAddressForHostMem has

    ASSERT ((Block != NULL));

and the UsbHcFreeMem has

    ASSERT (Block != NULL);

statement after for loop, but these are applicable only in DEBUG mode.
In RELEASE mode, if for whatever reasons there is no match inside the
for loop and the loop exits because of Block != NULL; condition, then
there is no "Block" NULL pointer check afterwards and the code proceeds
to do dereferencing "Block" which will lead to CRASH.

Hence, for safety add NULL pointer checks always.

Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4210
Signed-off-by: Ranbir Singh <Ranbir.Singh3@Dell.com>
Signed-off-by: Ranbir Singh <rsingh@ventanamicro.com>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
2023-07-17 02:19:45 +00:00
..
Application MdeModulePkg/CapsuleApp: Add EFIAPI to CompareFileNameInAlphabet() 2023-05-06 17:48:49 +00:00
Bus MdeModulePkg/Bus/Pci/EhciDxe: Fix FORWARD_NULL Coverity issues 2023-07-17 02:19:45 +00:00
Core MdeModulePkg: Remove other attribute protection in UnsetGuardPage 2023-06-30 11:07:40 +05:30
Include MdeModulePkg/Bus/Usb/UsbNetwork/UsbRndis: Add USB RNDIS devices support 2023-07-13 17:18:40 +00:00
Library MdeModulePkg/SmmCorePerformanceLib: Disable perf-logging at runtime 2023-06-21 04:37:17 +00:00
Logo MdeModulePkg/Logo: Add LoongArch64 architecture. 2022-10-14 02:16:33 +00:00
Test MdeModulePkg: Add more PciHostBridgeLib gmock support 2023-05-10 00:39:13 +00:00
Universal MdeModulePkg/Variable: TcgMorLockSmm Key Mismatch changes lock state 2023-07-10 12:24:59 +00:00
MdeModulePkg.ci.yaml MdeModulePkg: Update YAML to ignore specific ECC files/errors 2021-11-30 14:19:07 +00:00
MdeModulePkg.dec MdeModulePkg/Bus/Usb/UsbNetwork/UsbRndis: Add USB RNDIS devices support 2023-07-13 17:18:40 +00:00
MdeModulePkg.dsc MdeModulePkg/Bus/Usb/UsbNetwork/UsbCdcNcm: Add USB Cdc NCM devices support 2023-07-13 17:18:40 +00:00
MdeModulePkg.uni MdeModulePkg: Add TraceHubDebugSysTLib library 2023-05-11 07:26:38 +00:00
MdeModulePkgExtra.uni MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00