]> Git Repo - J-linux.git/commitdiff
ACPI: EC: Avoid returning AE_OK on errors in address space handler
authorArmin Wolf <[email protected]>
Wed, 22 May 2024 21:36:49 +0000 (23:36 +0200)
committerRafael J. Wysocki <[email protected]>
Mon, 27 May 2024 10:43:29 +0000 (12:43 +0200)
If an error code other than EINVAL, ENODEV or ETIME is returned
by acpi_ec_read() / acpi_ec_write(), then AE_OK is incorrectly
returned by acpi_ec_space_handler().

Fix this by only returning AE_OK on success, and return AE_ERROR
otherwise.

Signed-off-by: Armin Wolf <[email protected]>
[ rjw: Subject and changelog edits ]
Signed-off-by: Rafael J. Wysocki <[email protected]>
drivers/acpi/ec.c

index a68dce2147a4dbc37db9d904361c32a665eac579..68dd17f96f636f343f76418b1b870161816e50ba 100644 (file)
@@ -1351,8 +1351,10 @@ acpi_ec_space_handler(u32 function, acpi_physical_address address,
                return AE_NOT_FOUND;
        case -ETIME:
                return AE_TIME;
-       default:
+       case 0:
                return AE_OK;
+       default:
+               return AE_ERROR;
        }
 }
 
This page took 0.052578 seconds and 4 git commands to generate.