sh: fix memory corruption of unflattened device tree
authorRich Felker <dalias@libc.org>
Mon, 31 Jul 2017 05:27:50 +0000 (01:27 -0400)
committerRich Felker <dalias@libc.org>
Thu, 12 Apr 2018 23:47:51 +0000 (19:47 -0400)
commiteb6b6930a70faefe04479a71088cc10366782d9a
treea86769cb20fbc28fc58ef509058ad1a5bc81b97f
parent9b7e30ab975334448dc4c82941a48a3685a7642b
sh: fix memory corruption of unflattened device tree

unflatten_device_tree() makes use of memblock allocation, and
therefore must be called before paging_init() migrates the memblock
allocation data to the bootmem framework. Otherwise the record of the
allocation for the expanded device tree will be lost, and will
eventually be clobbered when allocated for another use.

Signed-off-by: Rich Felker <dalias@libc.org>
arch/sh/boards/of-generic.c
arch/sh/kernel/setup.c