audk/MdeModulePkg/Bus/Pci/UhciDxe
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
..
ComponentName.c MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
ComponentName.h MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Uhci.c MdeModulePkg: Fix conditionally uninitialized variables 2023-04-03 15:29:08 +00:00
Uhci.h MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
UhciDebug.c MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
UhciDebug.h MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
UhciDxe.inf MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00
UhciDxe.uni MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00
UhciDxeExtra.uni MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00
UhciQueue.c MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
UhciQueue.h MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
UhciReg.c MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
UhciReg.h MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
UhciSched.c MdeModulePkg/Bus/Pci/UhciDxe: Fix BAD_SHIFT Coverity issue 2023-09-22 04:56:35 +00:00
UhciSched.h MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
UsbHcMem.c MdeModulePkg/Bus/Pci/UhciDxe: Fix FORWARD_NULL Coverity issues 2023-09-22 04:56:35 +00:00
UsbHcMem.h MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00