]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
gpio: free irqs that are still requested when the chip is being removed
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Thu, 19 Sep 2024 13:51:04 +0000 (15:51 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Dec 2024 19:03:38 +0000 (20:03 +0100)
commit3946e07552de0cd6ea996fb11998ed1ecd67220d
treeab42c1f2f7baa1308caebdd5a53509e783b34d0b
parente26cbab9821a6e511ec839884517838ec596751e
gpio: free irqs that are still requested when the chip is being removed

[ Upstream commit ec8b6f55b98146c41dcf15e8189eb43291e35e89 ]

If we remove a GPIO chip that is also an interrupt controller with users
not having freed some interrupts, we'll end up leaking resources as
indicated by the following warning:

  remove_proc_entry: removing non-empty directory 'irq/30', leaking at least 'gpio'

As there's no way of notifying interrupt users about the irqchip going
away and the interrupt subsystem is not plugged into the driver model and
so not all cases can be handled by devlinks, we need to make sure to free
all interrupts before the complete the removal of the provider.

Reviewed-by: Herve Codina <herve.codina@bootlin.com>
Tested-by: Herve Codina <herve.codina@bootlin.com>
Link: https://lore.kernel.org/r/20240919135104.3583-1-brgl@bgdev.pl
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpio/gpiolib.c