From 111f82f2f68095ae3505f409e7309f6c0b5596bd Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 27 Sep 2017 13:34:29 -0400 Subject: [PATCH] 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 --- fallback.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fallback.c b/fallback.c index e7771db..341092c 100644 --- a/fallback.c +++ b/fallback.c @@ -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