audk/MdeModulePkg/Bus/Pci/EhciDxe
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
..
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
Ehci.c MdeModulePkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
Ehci.h MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
EhciDebug.c MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
EhciDebug.h MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
EhciDxe.inf MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00
EhciDxe.uni MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00
EhciDxeExtra.uni MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00
EhciReg.c MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
EhciReg.h MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
EhciSched.c MdeModulePkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
EhciSched.h MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
EhciUrb.c MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
EhciUrb.h MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
UsbHcMem.c MdeModulePkg/Bus/Pci/EhciDxe: Fix FORWARD_NULL Coverity issues 2023-07-17 02:19:45 +00:00
UsbHcMem.h MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00