diff options
author | Michael Walle <mwalle@kernel.org> | 2023-06-19 10:56:07 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-06-28 11:12:35 +0200 |
commit | 0357259cb103f1e48b4372bab50be45f2591c49f (patch) | |
tree | 4d0e801eb88dd07dfc2ca5d21a2063364bb15f1a /include/linux | |
parent | 8592ada80ea52f7d4ce283da6624fc372a31b455 (diff) | |
download | linux-stable-0357259cb103f1e48b4372bab50be45f2591c49f.tar.gz linux-stable-0357259cb103f1e48b4372bab50be45f2591c49f.tar.bz2 linux-stable-0357259cb103f1e48b4372bab50be45f2591c49f.zip |
gpiolib: Fix irq_domain resource tracking for gpiochip_irqchip_add_domain()
[ Upstream commit ff7a1790fbf92f1bdd0966d3f0da3ea808ede876 ]
Up until commit 6a45b0e2589f ("gpiolib: Introduce
gpiochip_irqchip_add_domain()") all irq_domains were allocated
by gpiolib itself and thus gpiolib also takes care of freeing it.
With gpiochip_irqchip_add_domain() a user of gpiolib can associate an
irq_domain with the gpio_chip. This irq_domain is not managed by
gpiolib and therefore must not be freed by gpiolib.
Fixes: 6a45b0e2589f ("gpiolib: Introduce gpiochip_irqchip_add_domain()")
Reported-by: Jiawen Wu <jiawenwu@trustnetic.com>
Signed-off-by: Michael Walle <mwalle@kernel.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/gpio/driver.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index 6aeea1071b1b..78bcb1639999 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h @@ -245,6 +245,14 @@ struct gpio_irq_chip { bool initialized; /** + * @domain_is_allocated_externally: + * + * True it the irq_domain was allocated outside of gpiolib, in which + * case gpiolib won't free the irq_domain itself. + */ + bool domain_is_allocated_externally; + + /** * @init_hw: optional routine to initialize hardware before * an IRQ chip will be added. This is quite useful when * a particular driver wants to clear IRQ related registers |