]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - arch/powerpc/cpu/mpc85xx/p1021_serdes.c
powerpc: mpc85xx/mpc86xx: Fix off-by-one boundary checking with ARRAY_SIZE
[karo-tx-uboot.git] / arch / powerpc / cpu / mpc85xx / p1021_serdes.c
index 1849c1642cf284d94187f8fe8021a67ba1e59058..d6d2696e0702a7cca22e35d80d1a9c559470a213 100644 (file)
@@ -73,7 +73,7 @@ void fsl_serdes_init(void)
 
        debug("PORDEVSR[IO_SEL_SRDS] = %x\n", srds_cfg);
 
-       if (srds_cfg > ARRAY_SIZE(serdes1_cfg_tbl)) {
+       if (srds_cfg >= ARRAY_SIZE(serdes1_cfg_tbl)) {
                printf("Invalid PORDEVSR[IO_SEL_SRDS] = %d\n", srds_cfg);
                return;
        }