summaryrefslogtreecommitdiffstats
path: root/arch/efi
diff options
context:
space:
mode:
Diffstat (limited to 'arch/efi')
-rw-r--r--arch/efi/efi/efi-device.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/efi/efi/efi-device.c b/arch/efi/efi/efi-device.c
index 7db8e48f7b..678a28399d 100644
--- a/arch/efi/efi/efi-device.c
+++ b/arch/efi/efi/efi-device.c
@@ -168,8 +168,10 @@ static struct efi_device *efi_add_device(efi_handle_t *handle, efi_guid_t **guid
efiret = BS->open_protocol(handle, &efi_device_path_protocol_guid,
&devpath, NULL, NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
- if (EFI_ERROR(efiret))
+ if (EFI_ERROR(efiret)) {
+ free(guidarr);
return ERR_PTR(-EINVAL);
+ }
efidev = xzalloc(sizeof(*efidev));