Skip to contentSkip to conversation

ACPI: Missing test after ioremap()?

PATCH Roel Kluin 1 participant 1 message Jul 30, 2009 ACPI

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

Isn't a test missing after the ioremap()?
and if so can we error out like this?

drivers/acpi/osl.c +5 -0
index 7167071..b1eeecc 100644
@@ -496,6 +496,9 @@ acpi_os_read_memory(acpi_physical_address phys_addr, u32 * value, u32 width)
 	void __iomem *virt_addr;
 
 	virt_addr = ioremap(phys_addr, width);
+	if (virt_addr == NULL)
+		return AE_ERROR;
+
 	if (!value)
 		value = &dummy;
 
@@ -524,6 +527,8 @@ acpi_os_write_memory(acpi_physical_address phys_addr, u32 value, u32 width)
 	void __iomem *virt_addr;
 
 	virt_addr = ioremap(phys_addr, width);
+	if (virt_addr == NULL)
+		return AE_ERROR;
 
 	switch (width) {
 	case 8: