summaryrefslogtreecommitdiff
path: root/drivers/acpi/ec.c
diff options
context:
space:
mode:
authorArmin Wolf <W_Armin@gmx.de>2024-05-22 23:36:49 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2024-05-27 12:43:29 +0200
commitc4bd7f1d78340e63de4d073fd3dbe5391e2996e5 (patch)
tree62e69c33206c27251f90aeacf8efa9c121e83d69 /drivers/acpi/ec.c
parentf6f172dc6a6d7775b2df6adfd1350700e9a847ec (diff)
ACPI: EC: Avoid returning AE_OK on errors in address space handler
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 <W_Armin@gmx.de> [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/ec.c')
-rw-r--r--drivers/acpi/ec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index a68dce2147a4..68dd17f96f63 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -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;
}
}