drivers/edac/mpc85xx_edac.c: correct offset_in_page mask bits in edac_mc_handle_ce()
authorKai.Jiang <Kai.Jiang@freescale.com>
Tue, 26 Jul 2011 23:08:49 +0000 (16:08 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 26 Jul 2011 23:49:45 +0000 (16:49 -0700)
Parameter offset_in_page in edac_mc_handle_ce() should mask the higher
bits above the page size, not the lower bits.  The original input
sometimes causes a crash.

Signed-off-by: Kai.Jiang <Kai.Jiang@freescale.com>
Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
Cc: Anton Vorontsov <avorontsov@mvista.com>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/edac/mpc85xx_edac.c

index 11e1a5dad96fe417963286227dcc244b96da82a9..8af8e864a9cffbc13c91c625a837e11bb8de24fe 100644 (file)
@@ -854,11 +854,11 @@ static void mpc85xx_mc_check(struct mem_ctl_info *mci)
                mpc85xx_mc_printk(mci, KERN_ERR, "PFN out of range!\n");
 
        if (err_detect & DDR_EDE_SBE)
-               edac_mc_handle_ce(mci, pfn, err_addr & PAGE_MASK,
+               edac_mc_handle_ce(mci, pfn, err_addr & ~PAGE_MASK,
                                  syndrome, row_index, 0, mci->ctl_name);
 
        if (err_detect & DDR_EDE_MBE)
-               edac_mc_handle_ue(mci, pfn, err_addr & PAGE_MASK,
+               edac_mc_handle_ue(mci, pfn, err_addr & ~PAGE_MASK,
                                  row_index, mci->ctl_name);
 
        out_be32(pdata->mc_vbase + MPC85XX_MC_ERR_DETECT, err_detect);