[PATCH] efi_loader: Assure fitImage from capsule is used from 8-byte aligned address

Marek Vasut marek.vasut at mailbox.org
Sat Nov 15 17:49:09 CET 2025


On 11/14/25 8:03 AM, Ilias Apalodimas wrote:

Hello Ilias,

>> +               img = memalign(8, image_size);
>> +               if (!img)
>> +                       return EFI_EXIT(EFI_BAD_BUFFER_SIZE);
>> +               memcpy(img, image, image_size);
>> +       } else {
>> +               img = (void *)image;
>> +       }
>> +
>> +       ret = fit_update(img);
>> +
>> +       if ((uintptr_t)image & 7)
>> +               free(img);
> 
> Initialize img to NULL and make the check a bit simpler to read (or
> get rid of it overall)
This part ^ I do not understand. The img variable is used by 
fit_update(img) , where should it be initialized to NULL ?


More information about the U-Boot mailing list