The patch titled Off-by-one in /arch/ppc/platforms/mpc8* has been added to the -mm tree. Its filename is off-by-one-in-arch-ppc-platforms-mpc8.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: Off-by-one in /arch/ppc/platforms/mpc8* From: Eric Sesterhenn <snakebyte@xxxxxx> A find -iname \*.[ch] | xargs grep "> ARRAY_SIZE(" revealed several incorrect usages of ARRAY_SIZE in the mpc drivers. The last element in the array is always ARRAY_SIZE()-1, this patch modifies the bounds checks accordingly. Signed-off-by: Eric Sesterhenn <snakebyte@xxxxxx> Cc: Vitaly Bordug <vbordug@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- arch/ppc/platforms/mpc8272ads_setup.c | 4 ++-- arch/ppc/platforms/mpc866ads_setup.c | 4 ++-- arch/ppc/platforms/mpc885ads_setup.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff -puN arch/ppc/platforms/mpc8272ads_setup.c~off-by-one-in-arch-ppc-platforms-mpc8 arch/ppc/platforms/mpc8272ads_setup.c --- a/arch/ppc/platforms/mpc8272ads_setup.c~off-by-one-in-arch-ppc-platforms-mpc8 +++ a/arch/ppc/platforms/mpc8272ads_setup.c @@ -196,7 +196,7 @@ static void __init mpc8272ads_fixup_enet bd_t* bi = (void*)__res; int fs_no = fsid_fcc1+pdev->id-1; - if(fs_no > ARRAY_SIZE(mpc82xx_enet_pdata)) { + if(fs_no >= ARRAY_SIZE(mpc82xx_enet_pdata)) { return; } @@ -222,7 +222,7 @@ static void mpc8272ads_fixup_uart_pdata( int id = fs_uart_id_scc2fsid(idx); /* no need to alter anything if console */ - if ((id <= num) && (!pdev->dev.platform_data)) { + if ((id < num) && (!pdev->dev.platform_data)) { pinfo = &mpc8272_uart_pdata[id]; pinfo->uart_clk = bd->bi_intfreq; pdev->dev.platform_data = pinfo; diff -puN arch/ppc/platforms/mpc866ads_setup.c~off-by-one-in-arch-ppc-platforms-mpc8 arch/ppc/platforms/mpc866ads_setup.c --- a/arch/ppc/platforms/mpc866ads_setup.c~off-by-one-in-arch-ppc-platforms-mpc8 +++ a/arch/ppc/platforms/mpc866ads_setup.c @@ -259,7 +259,7 @@ static void mpc866ads_fixup_enet_pdata(s /* Get pointer to Communication Processor */ cp = cpmp; - if(fs_no > ARRAY_SIZE(mpc8xx_enet_pdata)) { + if(fs_no >= ARRAY_SIZE(mpc8xx_enet_pdata)) { printk(KERN_ERR"No network-suitable #%d device on bus", fs_no); return; } @@ -305,7 +305,7 @@ static void __init mpc866ads_fixup_uart_ int id = fs_uart_id_smc2fsid(idx); /* no need to alter anything if console */ - if ((id <= num) && (!pdev->dev.platform_data)) { + if ((id < num) && (!pdev->dev.platform_data)) { pinfo = &mpc866_uart_pdata[id]; pinfo->uart_clk = bd->bi_intfreq; pdev->dev.platform_data = pinfo; diff -puN arch/ppc/platforms/mpc885ads_setup.c~off-by-one-in-arch-ppc-platforms-mpc8 arch/ppc/platforms/mpc885ads_setup.c --- a/arch/ppc/platforms/mpc885ads_setup.c~off-by-one-in-arch-ppc-platforms-mpc8 +++ a/arch/ppc/platforms/mpc885ads_setup.c @@ -263,7 +263,7 @@ static void mpc885ads_fixup_enet_pdata(s char *e; int i; - if(fs_no > ARRAY_SIZE(mpc8xx_enet_pdata)) { + if(fs_no >= ARRAY_SIZE(mpc8xx_enet_pdata)) { printk(KERN_ERR"No network-suitable #%d device on bus", fs_no); return; } @@ -371,7 +371,7 @@ static void __init mpc885ads_fixup_uart_ int id = fs_uart_id_smc2fsid(idx); /* no need to alter anything if console */ - if ((id <= num) && (!pdev->dev.platform_data)) { + if ((id < num) && (!pdev->dev.platform_data)) { pinfo = &mpc885_uart_pdata[id]; pinfo->uart_clk = bd->bi_intfreq; pdev->dev.platform_data = pinfo; _ Patches currently in -mm which might be from snakebyte@xxxxxx are off-by-one-in-arch-arm-common-icst.patch git-dvb.patch git-gfs2.patch possible-dereference-in.patch git-intelfb.patch git-netdev-all.patch remove-unnecessary-check-in-drivers-net-depcac.patch possible-null-dereference-in-net-core-rtnetlinkc.patch off-by-one-in-arch-ppc-platforms-mpc8.patch remove-unnecessary-check-in.patch git-scsi-misc.patch remove-unnecessary-check-in-drivers-scsi-sgc.patch overrun-in-drivers-scsi-scsic.patch uninitialized-variable-in-drivers-net-wan-syncpppc.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html