Skip to content

Commit

Permalink
MinPlatformPkg SerialPortTerminalLib: Fixing CodeQL issue Pointless c… (
Browse files Browse the repository at this point in the history
#311)

## Description

Cherry-pick Commit 03664aa #282 from release/202311 to dev/202405.
CodeQL is reporting Pointless comparison of unsigned value to zero for a
value derived from an unsigned PCD PcdDefaultTerminalType.

For details on how to complete these options and their meaning refer to
[CONTRIBUTING.md](https://github.com/microsoft/mu/blob/HEAD/CONTRIBUTING.md).

- [ ] Impacts functionality?
- [ ] Impacts security?
- [ ] Breaking change?
- [ ] Includes tests?
- [ ] Includes documentation?
- [X] Backport to release branch?

## How This Was Tested

Ran Local CI including codeQL setting and pipeline codeQL build.

## Integration Instructions

N/A

## upstream repo in EDK2?

tianocore/edk2-platforms#246

Co-authored-by: Aaron <[email protected]>
Co-authored-by: Aaron <[email protected]>
  • Loading branch information
3 people authored and ProjectMuBot committed Nov 14, 2024
1 parent 175663e commit b0dda71
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ AddSerialTerminal (
(int) mSerialDevicePath.Uart.StopBits,
(int) DefaultTerminalType));

if (DefaultTerminalType >= 0 &&
DefaultTerminalType < (sizeof (mTerminalType) / sizeof (mTerminalType[0]))) {
if (DefaultTerminalType < (sizeof (mTerminalType) / sizeof (mTerminalType[0]))) {
CopyMem (
(VOID *) &(mSerialDevicePath.TerminalType.Guid),
(VOID *) mTerminalType[DefaultTerminalType],
Expand Down

0 comments on commit b0dda71

Please sign in to comment.