Skip to content

Commit d7f5527

Browse files
adsunavathpela
authored andcommitted
sbchooser: fix load_secdb_from_file returning fd instead of rc
When read_file() fails, returning fd instead of rc causes callers to miss the error since fd is a non-negative integer after close(). Fix by returning rc. Signed-off-by: Aditya Nair <adnair@redhat.com>
1 parent ac9cc70 commit d7f5527

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/sbchooser-db.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ load_secdb_from_file(const char * const filename, efi_secdb_t **secdbp)
256256
close(fd);
257257
if (rc < 0) {
258258
efi_error("Could not read file \"%s\": %m", filename);
259-
return fd;
259+
return rc;
260260
}
261261
data_size -= 1;
262262

0 commit comments

Comments
 (0)