[PATCH 2/5] ARM: i.MX: iim: fix potential out of bounds array access

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The check is off-by-one.

Signed-off-by: Lucas Stach <dev@xxxxxxxxxx>
---
 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


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux