summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-stm32mp/bsec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm/mach-stm32mp/bsec.c b/arch/arm/mach-stm32mp/bsec.c
index f5f4b20d477..0dc1e5c3fdc 100644
--- a/arch/arm/mach-stm32mp/bsec.c
+++ b/arch/arm/mach-stm32mp/bsec.c
@@ -622,7 +622,7 @@ static int stm32mp_bsec_read(struct udevice *dev, int offset,
shadow = false;
}
- if ((offs % 4) || (size % 4))
+ if ((offs % 4) || (size % 4) || !size)
return -EINVAL;
if (IS_ENABLED(CONFIG_OPTEE) && priv->tee) {
@@ -678,7 +678,7 @@ static int stm32mp_bsec_write(struct udevice *dev, int offset,
shadow = false;
}
- if ((offs % 4) || (size % 4))
+ if ((offs % 4) || (size % 4) || !size)
return -EINVAL;
if (IS_ENABLED(CONFIG_OPTEE) && priv->tee) {