* [PATCH v1] nvmem: bsec: Fix incorrect size calculation for PTA read
@ 2025-01-07 11:30 Oleksij Rempel
0 siblings, 0 replies; only message in thread
From: Oleksij Rempel @ 2025-01-07 11:30 UTC (permalink / raw)
To: barebox; +Cc: Oleksij Rempel
Correct the size parameter in stm32_bsec_pta_read() to use sizeof(*val)
instead of sizeof(val). The previous implementation incorrectly
calculated the size of the pointer instead of the pointed-to value,
potentially causing incorrect behavior during the read operation.
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
drivers/nvmem/bsec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nvmem/bsec.c b/drivers/nvmem/bsec.c
index 22e30c6c2e82..3fa73488f9f7 100644
--- a/drivers/nvmem/bsec.c
+++ b/drivers/nvmem/bsec.c
@@ -153,7 +153,7 @@ static int stm32_bsec_pta_read(void *context, unsigned int offset, unsigned int
{
struct bsec_priv *priv = context;
- return stm32_bsec_optee_ta_read(priv->ctx, offset, val, sizeof(val));
+ return stm32_bsec_optee_ta_read(priv->ctx, offset, val, sizeof(*val));
}
static int stm32_bsec_pta_write(void *context, unsigned int offset, unsigned int val)
--
2.39.5
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-01-07 11:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-07 11:30 [PATCH v1] nvmem: bsec: Fix incorrect size calculation for PTA read Oleksij Rempel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox