Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit c4bd7f1

Browse files
Wer-Wolfrafaeljw
authored andcommitted
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>
1 parent f6f172d commit c4bd7f1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/acpi/ec.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1351,8 +1351,10 @@ acpi_ec_space_handler(u32 function, acpi_physical_address address,
13511351
return AE_NOT_FOUND;
13521352
case -ETIME:
13531353
return AE_TIME;
1354-
default:
1354+
case 0:
13551355
return AE_OK;
1356+
default:
1357+
return AE_ERROR;
13561358
}
13571359
}
13581360

0 commit comments

Comments
 (0)