Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]> Cc: Ray Ni <[email protected]> Co-authored-by: Veeresh Sangolli <[email protected]> Signed-off-by: Ranbir Singh <[email protected]> Signed-off-by: Ranbir Singh <[email protected]> Reviewed-by: Hao A Wu <[email protected]>
- Loading branch information