memory: Assert that memory_region_init_rom_device() ops aren't NULL
commit39e0b03dec518254fabd2acff29548d3f1d2b754
authorPeter Maydell <peter.maydell@linaro.org>
Mon, 4 Jul 2016 12:06:35 +0000 (4 13:06 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 4 Jul 2016 12:06:35 +0000 (4 13:06 +0100)
tree2f7ed6995935901c71b451261c67d89637ec20ff
parenta7aeb5f7b2c713e2ab7e0a142e0c89f7b2aa5bb7
memory: Assert that memory_region_init_rom_device() ops aren't NULL

It doesn't make sense to pass a NULL ops argument to
memory_region_init_rom_device(), because the effect will
be that if the guest tries to write to the memory region
then QEMU will segfault. Catch the bug earlier by sanity
checking the arguments to this function, and remove the
misleading documentation that suggests that passing NULL
might be sensible.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1467122287-24974-4-git-send-email-peter.maydell@linaro.org
include/exec/memory.h
memory.c