From e51e47d38ef2f15a2d81d48621121e0a30aad316 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Sun, 26 May 2013 15:00:30 +0800 Subject: powerpc: mpc85xx/mpc86xx: Fix off-by-one boundary checking with ARRAY_SIZE If a variable is used as array subscript, it's valid value range is 0 ... ARRAY_SIZE -1. Signed-off-by: Axel Lin Signed-off-by: Andy Fleming --- arch/powerpc/cpu/mpc85xx/t1040_serdes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/powerpc/cpu/mpc85xx/t1040_serdes.c') diff --git a/arch/powerpc/cpu/mpc85xx/t1040_serdes.c b/arch/powerpc/cpu/mpc85xx/t1040_serdes.c index 8261e03..19add9f 100644 --- a/arch/powerpc/cpu/mpc85xx/t1040_serdes.c +++ b/arch/powerpc/cpu/mpc85xx/t1040_serdes.c @@ -81,7 +81,7 @@ int is_serdes_prtcl_valid(int serdes, u32 prtcl) { int i; - if (prtcl > (ARRAY_SIZE(serdes_cfg_tbl[serdes]))) + if (prtcl >= ARRAY_SIZE(serdes_cfg_tbl[serdes])) return 0; for (i = 0; i < SRDS_MAX_LANES; i++) { -- cgit v1.1