vendor = (struct efi_device_path_vendor *)fp;
if (!guidcmp(&vendor->guid, guid))
- return efi_dp_dup(fp);
+ return efi_dp_dup(efi_dp_next(fp));
}
log_debug("VenMedia(%pUl) not found in %ls\n", &guid, lo->label);
*/
struct efi_device_path *efi_get_dp_from_boot(const efi_guid_t guid)
{
- struct efi_device_path *file_path = NULL;
- struct efi_device_path *tmp = NULL;
struct efi_load_option lo;
- void *var_value = NULL;
+ void *var_value;
efi_uintn_t size;
efi_status_t ret;
u16 var_name[16];
ret = efi_deserialize_load_option(&lo, var_value, &size);
if (ret != EFI_SUCCESS)
- goto out;
-
- tmp = efi_dp_from_lo(&lo, &guid);
- if (!tmp)
- goto out;
+ goto err;
- /* efi_dp_dup will just return NULL if efi_dp_next is NULL */
- file_path = efi_dp_dup(efi_dp_next(tmp));
+ return efi_dp_from_lo(&lo, &guid);
-out:
- efi_free_pool(tmp);
+err:
free(var_value);
-
- return file_path;
+ return NULL;
}