SecurityPkg/RngDxe: fix warning about uninitialized variable

ArmTrng.c: In function 'GenerateEntropy':
ArmTrng.c:40:15: error: 'Status' may be used uninitialized
  in this function [-Werror=maybe-uninitialized]

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

Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
This commit is contained in:
Mike Maslenkin 2025-01-09 21:10:13 +03:00 committed by Ard Biesheuvel
parent c58501aa1a
commit ceb87029c5
1 changed files with 5 additions and 1 deletions

View File

@ -44,6 +44,10 @@ GenerateEntropy (
UINTN Index;
UINTN MaxBits;
if ((Length == 0) || (Entropy == NULL)) {
return EFI_INVALID_PARAMETER;
}
ZeroMem (Entropy, Length);
RequiredEntropyBits = (Length << 3);
@ -67,5 +71,5 @@ GenerateEntropy (
Index += (EntropyBits >> 3);
} // while
return Status;
return EFI_SUCCESS;
}