summaryrefslogtreecommitdiffstats
path: root/arch/efi/efi
diff options
context:
space:
mode:
authorLucas Stach <dev@lynxeye.de>2016-03-02 21:50:33 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2016-03-04 07:54:58 +0100
commit93b5fca09593dc94e14507814b4ee360b8f1abef (patch)
tree973276334ceb32fc906a12f44c4f02622d933f99 /arch/efi/efi
parent3838a998c1bb3db455336257d65932007cc4503e (diff)
downloadbarebox-93b5fca09593dc94e14507814b4ee360b8f1abef.tar.gz
barebox-93b5fca09593dc94e14507814b4ee360b8f1abef.tar.xz
efi: fix memory leak in error path
Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/efi/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));