diff options
| author | Peter Jones <pjones@redhat.com> | 2017-09-27 13:34:29 -0400 |
|---|---|---|
| committer | Peter Jones <pmjones@gmail.com> | 2018-03-12 16:21:43 -0400 |
| commit | 111f82f2f68095ae3505f409e7309f6c0b5596bd (patch) | |
| tree | 890969e2eeaef5aa8ef3c35b2814ae9d907f1be2 /fallback.c | |
| parent | ea1d6905ba9aede0a09740a809ad7a1b89a08e98 (diff) | |
| download | efi-boot-shim-111f82f2f68095ae3505f409e7309f6c0b5596bd.tar.gz efi-boot-shim-111f82f2f68095ae3505f409e7309f6c0b5596bd.zip | |
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>
Diffstat (limited to 'fallback.c')
| -rw-r--r-- | fallback.c | 2 |
1 files changed, 0 insertions, 2 deletions
@@ -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 |
