Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
NishanthSanjeevi committed Dec 6, 2023
1 parent 8e516f9 commit 3b16a3a
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions DfciPkg/Library/DfciRecoveryLib/DfciRecoveryLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,20 +66,22 @@ GetRecoveryChallenge (
//
// Locate the RNG Protocol. This will be needed for the nonce.
Status = gBS->LocateProtocol (&gEfiRngProtocolGuid, NULL, (VOID **)&RngProtocol);
DEBUG ((DEBUG_VERBOSE, "%a: LocateProtocol(RNG) = %r\n", __FUNCTION__, Status));
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "%a: LocateProtocol(RNG) = %r\n", __FUNCTION__, Status));
return EFI_NOT_FOUND;
}

//
// From now on, don't proceed on errors.
//

//
// Allocate the buffer...
if (!EFI_ERROR (Status)) {
NewChallenge = AllocatePool (sizeof (DFCI_RECOVERY_CHALLENGE) + DFCI_MULTI_STRING_MAX_SIZE);
// Exit if we ran out of resources
if (NewChallenge == NULL) {
return EFI_OUT_OF_RESOURCES;
}
NewChallenge = AllocatePool (sizeof (DFCI_RECOVERY_CHALLENGE) + DFCI_MULTI_STRING_MAX_SIZE);

// Exit if we ran out of resources
if (NewChallenge == NULL) {
return EFI_OUT_OF_RESOURCES;
}

//
Expand Down

0 comments on commit 3b16a3a

Please sign in to comment.