audk/MdeModulePkg/Bus/Pci
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
..
EhciDxe MdeModulePkg/Bus/Pci/EhciDxe: Fix FORWARD_NULL Coverity issues 2023-07-17 02:19:45 +00:00
EhciPei MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
IdeBusPei MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
IncompatiblePciDeviceSupportDxe MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
NonDiscoverablePciDeviceDxe MdeModulePkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
NvmExpressDxe Add the volatile keyword to NvmExpressDxe's Passthru CQ 2023-05-08 01:56:16 +00:00
NvmExpressPei Add volatile keyword to NvmExpressPei's Passthru CQ 2023-05-08 01:56:16 +00:00
PciBusDxe MdeModulePkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
PciHostBridgeDxe MdeModulePkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
PciSioSerialDxe MdeModulePkg: Fix spelling error in PciSioSerialDxe 2022-10-25 22:30:33 +00:00
SataControllerDxe MdeModulePkg/SataControllerDxe: Fix up ASSERTS (Private != NULL) 2023-06-01 18:08:33 +00:00
SdMmcPciHcDxe MdeModulePkg SdMmcPciHcDxe: SD/MMC capability debug print is incorrect 2023-05-29 04:37:03 +00:00
SdMmcPciHcPei MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
UfsPciHcDxe MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
UfsPciHcPei MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
UhciDxe MdeModulePkg: Fix conditionally uninitialized variables 2023-04-03 15:29:08 +00:00
UhciPei MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
XhciDxe MdeModulePkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
XhciPei MdeModulePkg/XhciPei: Unlinked XhciPei memory block 2023-01-16 02:34:53 +00:00