diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpio/gpiolib-acpi.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c index c0929d938ced..df990f29757a 100644 --- a/drivers/gpio/gpiolib-acpi.c +++ b/drivers/gpio/gpiolib-acpi.c | |||
@@ -201,6 +201,10 @@ static acpi_status acpi_gpiochip_request_interrupt(struct acpi_resource *ares, | |||
201 | if (!handler) | 201 | if (!handler) |
202 | return AE_BAD_PARAMETER; | 202 | return AE_BAD_PARAMETER; |
203 | 203 | ||
204 | pin = acpi_gpiochip_pin_to_gpio_offset(chip, pin); | ||
205 | if (pin < 0) | ||
206 | return AE_BAD_PARAMETER; | ||
207 | |||
204 | desc = gpiochip_request_own_desc(chip, pin, "ACPI:Event"); | 208 | desc = gpiochip_request_own_desc(chip, pin, "ACPI:Event"); |
205 | if (IS_ERR(desc)) { | 209 | if (IS_ERR(desc)) { |
206 | dev_err(chip->dev, "Failed to request GPIO\n"); | 210 | dev_err(chip->dev, "Failed to request GPIO\n"); |
@@ -551,6 +555,12 @@ acpi_gpio_adr_space_handler(u32 function, acpi_physical_address address, | |||
551 | struct gpio_desc *desc; | 555 | struct gpio_desc *desc; |
552 | bool found; | 556 | bool found; |
553 | 557 | ||
558 | pin = acpi_gpiochip_pin_to_gpio_offset(chip, pin); | ||
559 | if (pin < 0) { | ||
560 | status = AE_BAD_PARAMETER; | ||
561 | goto out; | ||
562 | } | ||
563 | |||
554 | mutex_lock(&achip->conn_lock); | 564 | mutex_lock(&achip->conn_lock); |
555 | 565 | ||
556 | found = false; | 566 | found = false; |