m68k: fix ColdFire node shift size calculation
authorGreg Ungerer <gerg@linux-m68k.org>
Tue, 5 Sep 2017 12:57:06 +0000 (22:57 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 10 Dec 2017 12:40:39 +0000 (13:40 +0100)
commit162cefc5547b95f24c1a2aad2af1817381afa6a6
tree2c723385d4b9007d1c06323a54dd430c379f9c5d
parentff8cc6f882c735df53ae2e2fdde8362cafe14100
m68k: fix ColdFire node shift size calculation

[ Upstream commit f55ab8f27548ff3431a6567d400c6757c49fd520 ]

The m68k pg_data_table is a fix size array defined in arch/m68k/mm/init.c.
Index numbers within it are defined based on memory size. But for Coldfire
these don't take into account a non-zero physical RAM base address, and this
causes us to access past the end of this array at system start time.

Change the node shift calculation so that we keep the index inside its range.

Reported-by: Angelo Dureghello <angelo@sysam.it>
Tested-by: Angelo Dureghello <angelo@sysam.it>
Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/m68k/mm/mcfmmu.c