Branch: refs/heads/master
  Home:   https://github.com/tianocore/edk2
  Commit: e9f5d8c0e066da55b3f79dfdbf4df5fc97ca5916
      
https://github.com/tianocore/edk2/commit/e9f5d8c0e066da55b3f79dfdbf4df5fc97ca5916
  Author: Ranbir Singh <[email protected]>
  Date:   2023-09-22 (Fri, 22 Sep 2023)

  Changed paths:
    M MdeModulePkg/Bus/Pci/UhciDxe/UhciSched.c

  Log Message:
  -----------
  MdeModulePkg/Bus/Pci/UhciDxe: Fix BAD_SHIFT Coverity issue

The function UhciConvertPollRate has a check

    ASSERT (Interval != 0);

but this comes into play only in DEBUG mode. In Release mode, there is
no handling if the Interval parameter value is ZERO. To avoid shifting
by a negative amount later in the code flow in this undesirable case,
it is better to handle it as well by treating it same as if 1 is sent.

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]>


  Commit: 28a267af4024c329e58121ccd9bf5f4f7aabc0f4
      
https://github.com/tianocore/edk2/commit/28a267af4024c329e58121ccd9bf5f4f7aabc0f4
  Author: Ranbir Singh <[email protected]>
  Date:   2023-09-22 (Fri, 22 Sep 2023)

  Changed paths:
    M MdeModulePkg/Bus/Pci/UhciDxe/UsbHcMem.c

  Log Message:
  -----------
  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]>


Compare: https://github.com/tianocore/edk2/compare/f67e1934d985...28a267af4024


_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to