On 8/14/25 5:12 PM, Lucien.Jheng wrote: Hi,
Do you still need the min() function ^ here , now that size is surely <= max_size ?+ 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));
Besides that, I think the patch is pretty much ready.