mirror of
https://github.com/LongSoft/UEFITool.git
synced 2024-11-22 07:58:22 +08:00
Fix analyzer warnings
This commit is contained in:
parent
f863caac9d
commit
5c98152c58
@ -3419,9 +3419,7 @@ USTATUS FfsParser::parseFit(const UModelIndex & index)
|
||||
// Search for FIT
|
||||
UModelIndex fitIndex;
|
||||
UINT32 fitOffset;
|
||||
USTATUS result = findFitRecursive(index, fitIndex, fitOffset);
|
||||
if (result)
|
||||
return result;
|
||||
findFitRecursive(index, fitIndex, fitOffset);
|
||||
|
||||
// FIT not found
|
||||
if (!fitIndex.isValid())
|
||||
@ -3569,18 +3567,18 @@ USTATUS FfsParser::parseFit(const UModelIndex & index)
|
||||
return U_SUCCESS;
|
||||
}
|
||||
|
||||
USTATUS FfsParser::findFitRecursive(const UModelIndex & index, UModelIndex & found, UINT32 & fitOffset)
|
||||
void FfsParser::findFitRecursive(const UModelIndex & index, UModelIndex & found, UINT32 & fitOffset)
|
||||
{
|
||||
// Sanity check
|
||||
if (!index.isValid()) {
|
||||
return U_SUCCESS;
|
||||
return;
|
||||
}
|
||||
|
||||
// Process child items
|
||||
for (int i = 0; i < model->rowCount(index); i++) {
|
||||
findFitRecursive(index.child(i, 0), found, fitOffset);
|
||||
if (found.isValid())
|
||||
return U_SUCCESS;
|
||||
return;
|
||||
}
|
||||
|
||||
// Check for all FIT signatures in item's body
|
||||
@ -3597,13 +3595,11 @@ USTATUS FfsParser::findFitRecursive(const UModelIndex & index, UModelIndex & fou
|
||||
found = index;
|
||||
fitOffset = offset;
|
||||
msg(usprintf("%s: real FIT table found at physical address %08Xh", __FUNCTION__, fitAddress), found);
|
||||
return U_SUCCESS;
|
||||
break;
|
||||
}
|
||||
else if (model->rowCount(index) == 0) // Show messages only to leaf items
|
||||
msg(usprintf("%s: FIT table candidate found, but not referenced from the last VTF", __FUNCTION__), index);
|
||||
}
|
||||
|
||||
return U_SUCCESS;
|
||||
}
|
||||
|
||||
USTATUS FfsParser::parseFitEntryMicrocode(const UByteArray & microcode, const UINT32 localOffset, const UModelIndex & parent, UString & info, UINT32 &realSize)
|
||||
|
@ -149,7 +149,7 @@ private:
|
||||
USTATUS parseIntelMicrocodeHeader(const UByteArray & store, const UINT32 localOffset, const UModelIndex & parent, UModelIndex & index);
|
||||
|
||||
#ifdef U_ENABLE_FIT_PARSING_SUPPORT
|
||||
USTATUS findFitRecursive(const UModelIndex & index, UModelIndex & found, UINT32 & fitOffset);
|
||||
void findFitRecursive(const UModelIndex & index, UModelIndex & found, UINT32 & fitOffset);
|
||||
|
||||
// FIT entries
|
||||
USTATUS parseFitEntryMicrocode(const UByteArray & microcode, const UINT32 localOffset, const UModelIndex & parent, UString & info, UINT32 &realSize);
|
||||
|
@ -761,6 +761,8 @@ USTATUS NvramParser::getStoreSize(const UByteArray & data, const UINT32 storeOff
|
||||
else if (*signature == INTEL_MICROCODE_HEADER_VERSION) { // Intel microcode, must be checked after SLIC marker because of the same *signature values
|
||||
const INTEL_MICROCODE_HEADER* ucodeHeader = (const INTEL_MICROCODE_HEADER*)signature;
|
||||
storeSize = ucodeHeader->TotalSize;
|
||||
} else {
|
||||
return U_INVALID_PARAMETER; // Unreachable
|
||||
}
|
||||
return U_SUCCESS;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user