[U-Boot] [PATCH v13 4/4] efi: Rename bootefi_test_finish() to bootefi_run_finish()

Simon Glass sjg at chromium.org
Wed Nov 14 23:11:59 UTC 2018


Hi Alex,

On 14 November 2018 at 02:22, Alexander Graf <agraf at suse.de> wrote:
> On 11/14/2018 07:50 AM, Simon Glass wrote:
>>
>> This function can be used from do_bootefi_exec() so that we use mostly the
>> same code for a normal EFI application and an EFI test.
>>
>> Rename the function and use it in both places.
>>
>> Signed-off-by: Simon Glass <sjg at chromium.org>
>> ---
>>
>> Changes in v13:
>> - Drop 'efi_loader: Drop setup_ok' as we have an existing patch for that
>> - Drop patches previously applied
>>
>> Changes in v12: None
>> Changes in v11:
>> - Drop patches previously applied
>>
>> Changes in v9: None
>> Changes in v7:
>> - Drop patch "efi: Init the 'rows' and 'cols' variables"
>> - Drop patches previous applied
>>
>> Changes in v5:
>> - Rebase to master
>>
>> Changes in v4:
>> - Rebase to master
>>
>> Changes in v3:
>> - Add new patch to rename bootefi_test_finish() to bootefi_run_finish()
>>
>>   cmd/bootefi.c | 32 ++++++++++++++++----------------
>>   1 file changed, 16 insertions(+), 16 deletions(-)
>>
>> diff --git a/cmd/bootefi.c b/cmd/bootefi.c
>> index 492052d827a..317c7feb0a5 100644
>> --- a/cmd/bootefi.c
>> +++ b/cmd/bootefi.c
>> @@ -349,6 +349,20 @@ static efi_status_t bootefi_run_prepare(const char
>> *load_options_path,
>>         return 0;
>>   }
>>   +/**
>> + * bootefi_run_finish() - finish up after running an EFI test
>> + *
>> + * @image: Pointer to a struct which holds the loaded image info
>> + * @obj: Pointer to a struct which holds the loaded image object
>> + */
>> +static void bootefi_run_finish(struct efi_loaded_image *image,
>> +                              struct efi_loaded_image_obj *obj)
>> +{
>> +       efi_restore_gd();
>> +       free(image->load_options);
>> +       efi_delete_handle(&obj->header);
>> +}
>> +
>>   /**
>>    * do_bootefi_exec() - execute EFI binary
>>    *
>> @@ -466,8 +480,7 @@ static efi_status_t do_bootefi_exec(void *efi,
>>     exit:
>>         /* image has returned, loaded-image obj goes *poof*: */
>> -       if (obj)
>> -               efi_delete_handle(&obj->header);
>
>
> What about the conditional dereference? The new bootefi_run_finish()
> function is dropping that.

Hmm yes. Actually it looks like the error handling in this function is
a bit broken. I'll rework it, hopefully without breaking it further.

Regards,
Simon


More information about the U-Boot mailing list