audk/MdeModulePkg/Bus
Ranbir Singh 28a267af40 MdeModulePkg/Bus/Pci/UhciDxe: Fix FORWARD_NULL Coverity issues
The function UsbHcGetPciAddressForHostMem has

  ASSERT ((Block != NULL)); and

and the function 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 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.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4211

Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Co-authored-by: Veeresh Sangolli <veeresh.sangolli@dellteam.com>
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-09-22 04:56:35 +00:00
..
Ata MdeModulePkg/Bus/Ata/AtaBusDxe: Fix SIGN_EXTENSION Coverity issue 2023-09-20 05:47:00 +00:00
I2c/I2cDxe MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Isa Ps2KbdCtrller: Make wait for SUCCESS after BAT non-fatal 2022-10-25 15:58:27 +08:00
Pci MdeModulePkg/Bus/Pci/UhciDxe: Fix FORWARD_NULL Coverity issues 2023-09-22 04:56:35 +00:00
Scsi MdeModulePkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
Sd MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Ufs MdeModulePkg: Consume new alignment-related macros 2023-04-01 23:11:44 +00:00
Usb MdeModulePkg/Bus/Usb/UsbNetwork/UsbCdcNcm: Add USB Cdc NCM devices support 2023-07-13 17:18:40 +00:00