diff options
| author | Philippe Schenker <[email protected]> | 2025-11-11 08:16:26 +0100 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-11-18 12:50:05 -0600 |
| commit | 5d3697b7cf0006fee3fa12966643d605ae0777cc (patch) | |
| tree | c90752cf64c7e1e3aec3524f6f8853602d311bd8 /drivers | |
| parent | 46e372feb784f533cd92e73f51f90b4fe4d336e5 (diff) | |
remoteproc: k3-r5: cast size to size_t6dd
When compiling for R5 core with CONFIG_REMOTEPROC_TI_K3_R5F,
passing 'size' (ulong) to ti_secure_image_post_process() caused
a type mismatch compiler error.
On platforms where ulong and size_t differ in size, directly
casting could lead to out-of-bounds memory access. Fix by
introducing a size_t temporary variable, passing it to the
function, and writing back the potentially modified value for
use in subsequent calls.
Signed-off-by: Philippe Schenker <[email protected]>
Acked-by: Andrew Davis <[email protected]>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/remoteproc/ti_k3_r5f_rproc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/remoteproc/ti_k3_r5f_rproc.c b/drivers/remoteproc/ti_k3_r5f_rproc.c index c738607c109..48ebdaf0693 100644 --- a/drivers/remoteproc/ti_k3_r5f_rproc.c +++ b/drivers/remoteproc/ti_k3_r5f_rproc.c @@ -315,6 +315,7 @@ static int k3_r5f_load(struct udevice *dev, ulong addr, ulong size) bool mem_auto_init; void *image_addr = (void *)addr; int ret; + size_t size_img; dev_dbg(dev, "%s addr = 0x%lx, size = 0x%lx\n", __func__, addr, size); @@ -341,7 +342,9 @@ static int k3_r5f_load(struct udevice *dev, ulong addr, ulong size) k3_r5f_init_tcm_memories(core, mem_auto_init); - ti_secure_image_post_process(&image_addr, &size); + size_img = size; + ti_secure_image_post_process(&image_addr, &size_img); + size = size_img; ret = rproc_elf_load_image(dev, addr, size); if (ret < 0) { |
