diff mbox series

[20/23] efi: Correct assumption about if_type

Message ID 20220807154708.1418967-21-sjg@chromium.org
State Superseded
Delegated to: Tom Rini
Headers show
Series blk: Rationalise the block interface | expand

Commit Message

Simon Glass Aug. 7, 2022, 3:47 p.m. UTC
efi_set_blk_dev_to_system_partition() assumes that 0 is an invalid
if_type. This is true now but is about to be false. Fix this bug to avoid
a test failure.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 lib/efi_loader/efi_var_file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/lib/efi_loader/efi_var_file.c b/lib/efi_loader/efi_var_file.c
index 76a2ff9e412..994e66392fb 100644
--- a/lib/efi_loader/efi_var_file.c
+++ b/lib/efi_loader/efi_var_file.c
@@ -38,7 +38,7 @@  static efi_status_t __maybe_unused efi_set_blk_dev_to_system_partition(void)
 	char part_str[PART_STR_LEN];
 	int r;
 
-	if (!efi_system_partition.if_type) {
+	if (efi_system_partition.if_type == UCLASS_INVALID) {
 		log_err("No EFI system partition\n");
 		return EFI_DEVICE_ERROR;
 	}