summaryrefslogtreecommitdiff
path: root/drivers/acpi/acpi_watchdog.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2018-03-19 16:51:49 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-03-28 19:24:41 +0300
commit7fbddfb0017600bc5031448755ffa036ee57e31f (patch)
tree3723427812dee0882ecb46d962f855b74b7a4f8b /drivers/acpi/acpi_watchdog.c
parent8f860adbb3d80f1844fc284b2c2688f8c0905b87 (diff)
downloadlinux-7fbddfb0017600bc5031448755ffa036ee57e31f.tar.xz
ACPI / watchdog: Fix off-by-one error at resource assignment
commit b1abf6fc49829d89660c961fafe3f90f3d843c55 upstream. The resource allocation in WDAT watchdog has off-one-by error, it sets one byte more than the actual end address. This may eventually lead to unexpected resource conflicts. Fixes: 058dfc767008 (ACPI / watchdog: Add support for WDAT hardware watchdog) Cc: 4.9+ <stable@vger.kernel.org> # 4.9+ Signed-off-by: Takashi Iwai <tiwai@suse.de> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Acked-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/acpi/acpi_watchdog.c')
-rw-r--r--drivers/acpi/acpi_watchdog.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/acpi/acpi_watchdog.c b/drivers/acpi/acpi_watchdog.c
index 11b113f8e367..ebb626ffb5fa 100644
--- a/drivers/acpi/acpi_watchdog.c
+++ b/drivers/acpi/acpi_watchdog.c
@@ -74,10 +74,10 @@ void __init acpi_watchdog_init(void)
res.start = gas->address;
if (gas->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) {
res.flags = IORESOURCE_MEM;
- res.end = res.start + ALIGN(gas->access_width, 4);
+ res.end = res.start + ALIGN(gas->access_width, 4) - 1;
} else if (gas->space_id == ACPI_ADR_SPACE_SYSTEM_IO) {
res.flags = IORESOURCE_IO;
- res.end = res.start + gas->access_width;
+ res.end = res.start + gas->access_width - 1;
} else {
pr_warn("Unsupported address space: %u\n",
gas->space_id);