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

ArmPkg: MdeModulePkg: OvmfPkg: SecurityPkg: ShellPkg: fix [-Werror=maybe-uninitialized] #10603

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
1 change: 1 addition & 0 deletions ArmPkg/Drivers/ArmGic/ArmGicLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ ArmGicAcknowledgeInterrupt (
// Report Spurious interrupt which is what the above controllers would
// return if no interrupt was available
Value = 1023;
IntId = Value;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I had a look at this function. Hated it. Since it does two things, and it's just weird. Wrong level of abstraction.

So I went and had a look at who's actually using the insane interface. Turns out no one is. Last user disappeared with 96c8e75 "ArmPlatformPkg/PrePeiCore: Drop MPCore variant".

So could we instead delete the function, and its prototype in ArmPkg/Include/Library/ArmGicLib.h?

}

if (InterruptId != NULL) {
Expand Down
2 changes: 2 additions & 0 deletions MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressMediaSanitize.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,8 @@ NvmExpressMediaClear (
return EFI_INVALID_PARAMETER;
}

Status = EFI_SUCCESS;

//
// Per NIST 800-88r1, one or more pass of writes may be alteratively used.
//
Expand Down
2 changes: 2 additions & 0 deletions MdeModulePkg/Core/Dxe/Hand/Handle.c
Original file line number Diff line number Diff line change
Expand Up @@ -1107,6 +1107,8 @@ CoreOpenProtocol (
return EFI_INVALID_PARAMETER;
}

Prot = NULL;

//
// Lock the protocol database
//
Expand Down
10 changes: 5 additions & 5 deletions MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -1563,6 +1563,11 @@ EvacuateTempRam (

DEBUG ((DEBUG_VERBOSE, "Beginning evacuation of content in temporary RAM.\n"));

//
// By default migrate all FVs and copy raw data
//
FvMigrationFlags = FLAGS_FV_RAW_DATA_COPY;

//
// Migrate PPI Pointers of PEI_CORE from temporary memory to newly loaded PEI_CORE in permanent memory.
//
Expand Down Expand Up @@ -1617,11 +1622,6 @@ EvacuateTempRam (
//
return EFI_SUCCESS;
}

//
// Migrate all FVs and copy raw data
//
FvMigrationFlags = FLAGS_FV_RAW_DATA_COPY;
} else {
for (Index = 0; Index < MigrationInfo->ToMigrateFvCount; Index++) {
ToMigrateFvInfo = ((TO_MIGRATE_FV_INFO *)(MigrationInfo + 1)) + Index;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ QemuLoadKernelImage (
goto CloseRoot;
}

CommandLine = NULL;
if (CommandLineSize == 0) {
KernelLoadedImage->LoadOptionsSize = 0;
} else {
Expand Down
1 change: 1 addition & 0 deletions SecurityPkg/RandomNumberGenerator/RngDxe/ArmTrng.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ GenerateEntropy (

ZeroMem (Entropy, Length);

Status = EFI_INVALID_PARAMETER;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it may be better to validate the input arguments before line 47.

if ((Length ==0) || (Entropy == NULL)) {
return EFI_INVALID_PARAMETER;
}

That way it will also fix the issue at line 47 if Entropy is NULL.

RequiredEntropyBits = (Length << 3);
Index = 0;
CollectedEntropyBits = 0;
Expand Down
23 changes: 13 additions & 10 deletions ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ GetImageExecutionInfo (

ptr = (CHAR8 *)ExecInfoTablePtr + 1;

Status = EFI_NOT_FOUND;

for (Image = 0; Image < *NumberOfImages; Image++, ptr += InfoPtr->InfoSize) {
InfoPtr = (EFI_IMAGE_EXECUTION_INFO *)ptr;
ImagePath = (CHAR16 *)(InfoPtr + 1);
Expand Down Expand Up @@ -287,6 +289,7 @@ DisplayConformanceProfiles (
UINTN Profile;
EFI_CONFORMANCE_PROFILES_TABLE *ConfProfTable;

Status = EFI_SUCCESS;
ShellStatus = SHELL_SUCCESS;

if (Address != 0) {
Expand Down Expand Up @@ -571,19 +574,19 @@ ShellCommandRunDmem (
HiiDatabaseExportBufferAddress,
ConformanceProfileTableAddress
);
}

if (ShellCommandLineGetFlag (Package, L"-verbose")) {
if (ShellStatus == SHELL_SUCCESS) {
ShellStatus = DisplayRtProperties (RtPropertiesTableAddress);
}
if (ShellCommandLineGetFlag (Package, L"-verbose")) {
if (ShellStatus == SHELL_SUCCESS) {
ShellStatus = DisplayRtProperties (RtPropertiesTableAddress);
}

if (ShellStatus == SHELL_SUCCESS) {
ShellStatus = DisplayImageExecutionEntries (ImageExecutionTableAddress);
}
if (ShellStatus == SHELL_SUCCESS) {
ShellStatus = DisplayImageExecutionEntries (ImageExecutionTableAddress);
}

if (ShellStatus == SHELL_SUCCESS) {
ShellStatus = DisplayConformanceProfiles (ConformanceProfileTableAddress);
if (ShellStatus == SHELL_SUCCESS) {
ShellStatus = DisplayConformanceProfiles (ConformanceProfileTableAddress);
}
}
}
} else {
Expand Down
Loading