diff options
| author | Weijie Gao <[email protected]> | 2025-09-08 16:34:02 +0800 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-09-18 15:43:05 -0600 |
| commit | 63585689686fee83b382edacad249a4ec35d7c3d (patch) | |
| tree | 75e7d1f7be6553e8a3b131556395687da2eb7348 /drivers | |
| parent | b5da53046c303d7cff586b366f225dc4c3b64686 (diff) | |
misc: fs_loader: allow returning actual firmware data size in request_firmware_into_buf_via_script()
It's important to return the actual firmware data size as some
firmware files may have no checksum and need the size as the only
way for firmware validation check.
Signed-off-by: Weijie Gao <[email protected]>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/misc/fs_loader.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/misc/fs_loader.c b/drivers/misc/fs_loader.c index 60296d55f23..87acd385e23 100644 --- a/drivers/misc/fs_loader.c +++ b/drivers/misc/fs_loader.c @@ -229,7 +229,8 @@ int request_firmware_into_buf(struct udevice *dev, } int request_firmware_into_buf_via_script(void **buf, size_t max_size, - const char *script_name) + const char *script_name, + size_t *retsize) { ulong addr, size; int ret; @@ -269,6 +270,9 @@ int request_firmware_into_buf_via_script(void **buf, size_t max_size, return -E2BIG; } + if (retsize) + *retsize = size; + memcpy(*buf, (void *)addr, size); return 0; |
