]> Git Repo - linux.git/commitdiff
ACPI, APEI, Fix error return value in apei_map_generic_address()
authorAili Yao <[email protected]>
Tue, 10 Nov 2020 08:33:34 +0000 (00:33 -0800)
committerRafael J. Wysocki <[email protected]>
Mon, 16 Nov 2020 18:27:37 +0000 (19:27 +0100)
From commit 6915564dc5a8 ("ACPI: OSL: Change the type of
acpi_os_map_generic_address() return value"),
acpi_os_map_generic_address() will return logical address or NULL
for error, but for ACPI_ADR_SPACE_SYSTEM_IO case, it should be also
return 0 as it's a normal case, but now it will return -ENXIO.

So check it out for such case to avoid einj module initialization
fail.

Fixes: 6915564dc5a8 ("ACPI: OSL: Change the type of acpi_os_map_generic_address() return value")
Cc: <[email protected]>
Reviewed-by: James Morse <[email protected]>
Tested-by: Tony Luck <[email protected]>
Signed-off-by: Aili Yao <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
drivers/acpi/apei/apei-base.c

index 552fd9ffaca4e2d530cfc5151df76a82409f973f..3294cc8dc0730340c2b9703b09a8952ae60019a2 100644 (file)
@@ -633,6 +633,10 @@ int apei_map_generic_address(struct acpi_generic_address *reg)
        if (rc)
                return rc;
 
+       /* IO space doesn't need mapping */
+       if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_IO)
+               return 0;
+
        if (!acpi_os_map_generic_address(reg))
                return -ENXIO;
 
This page took 0.054982 seconds and 4 git commands to generate.