diff options
author | Andre Heider <a.heider@gmail.com> | 2013-10-19 14:20:47 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-10-22 15:28:58 +0200 |
commit | 0fdd91d92b7eac2161dbcec2032d055eb2b90b04 (patch) | |
tree | 02c3219cc6b72b59f324657cd24541ce2e8d5cdc /include/common.h | |
parent | 5611ccb0422ba938519c20c4f7ce08c7c940b427 (diff) | |
download | barebox-0fdd91d92b7eac2161dbcec2032d055eb2b90b04.tar.gz barebox-0fdd91d92b7eac2161dbcec2032d055eb2b90b04.tar.xz |
ARM: cache: do not crash when the MMU isn't yet setup
Drivers currently cannot implement explicit cache handling and rely on
running the same code before and after mmu_initcall() without crashing.
Depending on the chosen config options, the cache functions are not yet
setup and using them early on ends in a null pointer dereference.
The RPi's mailbox driver is such a case; it requires cache handling once
the MMU is fully set up and yet the RPi setup needs to use the driver to
get the memory size before mem_initcall() and hence mmu_initcall().
Fix this by checking the cache_fns pointer before dereferencing it.
Signed-off-by: Andre Heider <a.heider@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/common.h')
0 files changed, 0 insertions, 0 deletions