[PATCH 1/5] efi_loader: check the status of disconnected drivers

Ilias Apalodimas ilias.apalodimas at linaro.org
Thu Jun 15 16:39:37 CEST 2023


efi_uninstall_protocol() calls efi_disconnect_all_drivers() but never
checks the return value.  Honor that and return an appropriate error
if the associated controllers failed to disconnect

Signed-off-by: Ilias Apalodimas <ilias.apalodimas at linaro.org>
---
 lib/efi_loader/efi_boottime.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index 5006c0e1e4af..68198e6b5ff6 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -1353,7 +1353,11 @@ static efi_status_t efi_uninstall_protocol
 	if (r != EFI_SUCCESS)
 		goto out;
 	/* Disconnect controllers */
-	efi_disconnect_all_drivers(efiobj, protocol, NULL);
+	r = efi_disconnect_all_drivers(efiobj, protocol, NULL);
+	if (r != EFI_SUCCESS) {
+		r = EFI_DEVICE_ERROR;
+		goto out;
+	}
 	/* Close protocol */
 	list_for_each_entry_safe(item, pos, &handler->open_infos, link) {
 		if (item->info.attributes ==
-- 
2.39.2



More information about the U-Boot mailing list