Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix hii opcode handle leak #744

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ghbaccount
Copy link
Contributor

Actually this was a part of findings fixed by tianocore/edk2#6424
But when I tried to build /Ampere/JadePkg/Jade.dsc I've got a bunch of other [-Werror=maybe-uninitialized] warnings.

This patch fixes a bunch of warnings similar to:
Ampere/JadePkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.c:446:15:
  error: 'Status' may be used uninitialized in this function
  [-Werror=maybe-uninitialized]

   EFI_STATUS  Status;
               ^~~~~~
cc1: all warnings being treated as errors

And a single warning about MemorySize variable:
SmbiosPlatformDxe/Type19/PlatformMemoryArrayMappedAddressFunction.c:131:12:
  error: 'MemorySize' may be used uninitialized in this function
  [-Werror=maybe-uninitialized]

         if (MemorySize != 0) {
            ^
cc1: all warnings being treated as errors

Signed-off-by: Mike Maslenkin <[email protected]>
This patch fixes the following warnings:

RootComplexConfigDxe/RootComplexConfigDxe.c: In function 'RouteConfig':
RootComplexConfigDxe/RootComplexConfigDxe.c:341:12: error: 'VarStoreConfig'
  may be used uninitialized in this function [-Werror=maybe-uninitialized]
   Status = HiiConfigRouting->ConfigToBlock (
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                HiiConfigRouting,
                                ~~~~~~~~~~~~~~~~~
                                Configuration,
                                ~~~~~~~~~~~~~~
                                (UINT8 *)VarStoreConfig,
                                ~~~~~~~~~~~~~~~~~~~~~~~~
                                &BufferSize,
                                ~~~~~~~~~~~~
                                Progress
                                ~~~~~~~~
                                );
                                ~
SystemFirmwareUpdateDxe/SystemFirmwareUpdateDxe.c:
  In function 'SystemFirmwareUpdateSetVariable':
SystemFirmwareUpdateDxe/SystemFirmwareUpdateDxe.c:269:25:
  error: 'SubId' may be used uninitialized in this function
  [-Werror=maybe-uninitialized]

   mUpdateFWSubId        = SubId;
   ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~

cc1: all warnings being treated as errors

Signed-off-by: Mike Maslenkin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant