[U-Boot, v5, 1/1] misc: fs_loader: Add request_firmware_into_buf_via_script() for flexible firmware loading via U-Boot script

Lucien.Jheng lucienzx159 at gmail.com
Sun Aug 17 16:19:11 CEST 2025


Marek Vasut 於 2025/8/17 下午 08:27 寫道:
> On 8/14/25 5:12 PM, Lucien.Jheng wrote:
>
> Hi,
>
>> +    if (size > max_size) {
>> +        log_err("Loaded firmware size 0x%lx exceeded maximum allowed 
>> size 0x%lx.\n",
>> +            size, max_size);
>> +        return -E2BIG;
>> +    }
>> +
>> +    memcpy(*buf, (void *)addr, min(size, max_size));
> Do you still need the min() function ^ here , now that size is surely 
> <= max_size ?
>
> Besides that, I think the patch is pretty much ready.

Hi Marek

The min() function isn't needed. I'll make that change and submit a new 
patch shortly.

Thanks!



More information about the U-Boot mailing list