Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
efi/main: set/check for NULL in efi_create_binding()
If LibLocateHandle() returns success and either 0 handles or we find no
matching handles, treat it the same.

Originally-By: Patrick Masotta <masottaus@yahoo.com>
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
  • Loading branch information
ppatpat authored and geneC committed Aug 1, 2015
1 parent f858a54 commit e466d24
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions efi/main.c
Expand Up @@ -81,7 +81,7 @@ bool efi_get_MAC( EFI_DEVICE_PATH * pDevPath, uint8_t * mac, uint16_t mac_size)
/* As of UEFI-2.4.0, all EFI_SERVICE_BINDINGs are for networking */
struct efi_binding *efi_create_binding(EFI_GUID *bguid, EFI_GUID *pguid)
{
EFI_SERVICE_BINDING *sbp;
EFI_SERVICE_BINDING *sbp = NULL;
struct efi_binding *b;
EFI_STATUS status;
EFI_HANDLE sb_handle, protocol, child;
Expand Down Expand Up @@ -126,7 +126,7 @@ struct efi_binding *efi_create_binding(EFI_GUID *bguid, EFI_GUID *pguid)

}
}
if (status != EFI_SUCCESS)
if (status != EFI_SUCCESS || sbp == NULL)
goto free_binding;

child = NULL;
Expand Down

0 comments on commit e466d24

Please sign in to comment.