[PATCH 3/5] fs: efi: avoid comparison with uninitialized variable
Lucas Stach
dev at lynxeye.de
Wed Mar 2 12:50:35 PST 2016
volume will only be initialized when efi_loaded_image is
set.
Signed-off-by: Lucas Stach <dev at lynxeye.de>
---
fs/efi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/efi.c b/fs/efi.c
index a7adcb9..0f74cda 100644
--- a/fs/efi.c
+++ b/fs/efi.c
@@ -527,7 +527,7 @@ int efi_fs_probe(struct efi_device *efidev)
BS->handle_protocol(efi_loaded_image->device_handle,
&efi_simple_file_system_protocol_guid, (void*)&volume);
- if (efidev->protocol == volume)
+ if (efi_loaded_image && efidev->protocol == volume)
path = xstrdup("/boot");
else
path = asprintf("/efi%d", index);
--
2.5.0
More information about the barebox
mailing list