SecurityPkg/HashLibTpm2: Fix unused variable usage

There is an unused variable in
SecurityPkg/Library/HashLibTpm2/HashLibTpm2PeilessSecLib.c
which is spotted by CLANG builds.

The correct fix here is not to just remove the unused assignment,
but rather to fix the line following it, which should have been using
the unused value in the way that it now does.

Fixes: 9c651ef83a

Co-authored-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Mike Beaton <mjsbeaton@gmail.com>
This commit is contained in:
Mike Beaton 2025-11-29 14:37:07 +00:00 committed by Ard Biesheuvel
parent aacfbe667e
commit 7410754041

View file

@ -586,9 +586,7 @@ HasLibTpm2PeilessSecLibConstructor (
}
TcgPcrEvent = (TCG_PCR_EVENT *)EventLog;
TcgEfiSpecIdEventStruct = (TCG_EfiSpecIDEventStruct *)
(EventLog + OFFSET_OF (TCG_PCR_EVENT, Event));
TcgEfiSpecIdEventStruct = (TCG_EfiSpecIDEventStruct *)TcgPcrEvent->Event;
CopyMem (&NumberOfAlgorithms, TcgEfiSpecIdEventStruct + 1, sizeof (NumberOfAlgorithms));
DigestSize = (TCG_EfiSpecIdEventAlgorithmSize *)((UINT8 *)TcgEfiSpecIdEventStruct + sizeof (*TcgEfiSpecIdEventStruct) + sizeof (NumberOfAlgorithms));