mirror of
https://git.proxmox.com/git/efi-boot-shim
synced 2025-08-15 06:12:41 +00:00
fallback: find_boot_csv(): eliminate dead code.
Covscan sez: 720 FreePool(buffer); assignment: Assigning: buffer = NULL. 721 buffer = NULL; 722 723 CHAR16 *bootcsv=NULL, *bootarchcsv=NULL; 724 725 bs = 0; 726 do { 727 bs = 0; 728 rc = uefi_call_wrapper(fh->Read, 3, fh, &bs, NULL); 729 if (EFI_ERROR(rc) && rc != EFI_BUFFER_TOO_SMALL) { 730 Print(L"Could not read \\EFI\\%s\\: %d\n", dirname, rc); null: At condition buffer, the value of buffer must be NULL. dead_error_condition: The condition buffer cannot be true. 731 if (buffer) CID 182851 (#1 of 1): Logically dead code (DEADCODE)dead_error_line: Execution cannot reach this statement: FreePool(buffer);. 732 FreePool(buffer); 733 return rc; 734 } And it's right; buffer can never be non-NULL there. So just take that out. Signed-off-by: Peter Jones <pjones@redhat.com>
This commit is contained in:
parent
ea1d6905ba
commit
111f82f2f6
@ -733,8 +733,6 @@ find_boot_csv(EFI_FILE_HANDLE fh, CHAR16 *dirname)
|
||||
if (EFI_ERROR(rc) && rc != EFI_BUFFER_TOO_SMALL) {
|
||||
Print(L"Could not read \\EFI\\%s\\: %d\n", dirname,
|
||||
rc);
|
||||
if (buffer)
|
||||
FreePool(buffer);
|
||||
return rc;
|
||||
}
|
||||
/* If there's no data to read, don't try to allocate 0 bytes
|
||||
|
Loading…
Reference in New Issue
Block a user