]> www.infradead.org Git - users/jedix/linux-maple.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)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 30 Sep 2024 08:10:45 +0000 (10:10 +0200)
commitec8b6f55b98146c41dcf15e8189eb43291e35e89
treeff0c07db8044cb94d2cb3e67ef8cc21d1cc12959
parent9852d85ec9d492ebef56dc5f229416c925758edc
gpio: free irqs that are still requested when the chip is being removed

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>
drivers/gpio/gpiolib.c