summaryrefslogtreecommitdiff
path: root/lib/fault-inject.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2011-02-08 22:37:16 (GMT)
committerRafael J. Wysocki <rjw@sisk.pl>2011-02-08 22:37:16 (GMT)
commit884b821fa27a5e3714d4871976d3e7c3abfa0d1b (patch)
tree3ac23b3a2a3fc881efb3a255d5ad42bde8737051 /lib/fault-inject.c
parent100b33c8bd8a3235fd0b7948338d6cbb3db3c63d (diff)
downloadlinux-fsl-qoriq-884b821fa27a5e3714d4871976d3e7c3abfa0d1b.tar.xz
ACPI: Fix acpi_os_read_memory() and acpi_os_write_memory() (v2)
The functions acpi_os_read_memory() and acpi_os_write_memory() do two wrong things. First, they shouldn't call rcu_read_unlock() before the looked up address is actually used for I/O, because in that case the iomap it belongs to may be removed before the I/O is done. Second, if they have to create a new mapping, they should check the returned virtual address and tell the caller that the operation failed if it is NULL (in fact, I think they even should not attempt to map an address that's not present in one of the existing ACPI iomaps, because that may cause problems to happen when they are called from nonpreemptible context and their callers ought to know what they are doing and map the requisite memory regions beforehand). Make these functions call rcu_read_unlock() when the I/O is complete (or if it's necessary to map the given address "on the fly") and return an error code if the requested physical address is not present in the existing ACPI iomaps and cannot be mapped. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'lib/fault-inject.c')
0 files changed, 0 insertions, 0 deletions