On 09.11.2021 22:52, Stefano Stabellini wrote:
> @@ -862,6 +856,7 @@ static int __init efi_check_dt_boot(EFI_LOADED_IMAGE
> *loaded_image)
> {
> int chosen, node, addr_len, size_len;
> unsigned int i = 0, modules_found = 0;
> + CHAR16 *fname;
>
> /* Check for the chosen node in the current DTB */
> chosen = setup_chosen_node(fdt, &addr_len, &size_len);
> @@ -871,6 +866,8 @@ static int __init efi_check_dt_boot(EFI_LOADED_IMAGE
> *loaded_image)
> return ERROR_DT_CHOSEN_NODE;
> }
>
> + dir_handle = get_parent_handle(loaded_image, &fname);
> +
> /* Check for nodes compatible with xen,domain under the chosen node */
> for ( node = fdt_first_subnode(fdt, chosen);
> node > 0;
> @@ -902,6 +899,8 @@ static int __init efi_check_dt_boot(EFI_LOADED_IMAGE
> *loaded_image)
> efi_bs->FreePool(modules[i].name);
> }
>
> + if ( dir_handle )
> + dir_handle->Close(dir_handle);
Weren't we there before, resulting in the same problem that Luca's
change attempted to fix? get_parent_handle() simply shouldn't be
called unconditionally aiui. I could see closing of the handle to
happen here, but its opening imo should happen the first time
allocate_module_file() is actually reached.
Jan