[PATCH 2/5] ARM: i.MX: iim: fix potential out of bounds array access
Lucas Stach
dev at lynxeye.de
Wed Jul 6 12:32:49 PDT 2016
The check is off-by-one.
Signed-off-by: Lucas Stach <dev at lynxeye.de>
---
arch/arm/mach-imx/iim.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/mach-imx/iim.c b/arch/arm/mach-imx/iim.c
index c3ba67e..6addfed 100644
--- a/arch/arm/mach-imx/iim.c
+++ b/arch/arm/mach-imx/iim.c
@@ -196,7 +196,7 @@ int imx_iim_read(unsigned int banknum, int offset, void *buf, int count)
if (!imx_iim)
return -ENODEV;
- if (banknum > IIM_NUM_BANKS)
+ if (banknum >= IIM_NUM_BANKS)
return -EINVAL;
bank = iim->bank[banknum];
--
2.7.4
More information about the barebox
mailing list