Skip to contentSkip to conversation

ACPI, APEI: fix acpi_pre_map() return value.

Patch-next Jin Dongming 1 participant 1 message Sep 6, 2010 ACPI

lore
Share & tools
lore
#0 lore raw

After we ioremap() a new region, we call __acpi_try_ioremap() to see whether another thread has already mapped the same region. This check clobbers "vaddr", so compute the return value of acpi_pre_map() using the ioremap() result "map->vaddr" instead.

v2:
Modified the unsuitable description of patch.

v3:
Removed unlikely() check and made description simpler.

---
 drivers/acpi/atomicio.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/acpi/atomicio.c +1 -1
index 8f8bd73..542e539 100644
@@ -142,7 +142,7 @@ static void __iomem *acpi_pre_map(phys_addr_t paddr,
 	list_add_tail_rcu(&map->list, &acpi_iomaps);
 	spin_unlock_irqrestore(&acpi_iomaps_lock, flags);
 
-	return vaddr + (paddr - pg_off);
+	return map->vaddr + (paddr - map->paddr);
 err_unmap:
 	iounmap(vaddr);
 	return NULL;
Signature · 1 line
1.7.1.1