Skip to content
Commit 19ec11a2 authored by Bartosz Golaszewski's avatar Bartosz Golaszewski
Browse files

gpio: em: remove the gpiochip before removing the irq domain

In commit 8764c4ca

 ("gpio: em: use the managed version of
gpiochip_add_data()") we implicitly altered the ordering of resource
freeing: since gpiochip_remove() calls gpiochip_irqchip_remove()
internally, we now can potentially use the irq_domain after it was
destroyed in the remove() callback (as devm resources are freed after
remove() has returned).

Use devm_add_action_or_reset() to keep the ordering right and entirely
kill the remove() callback in the driver.

Reported-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Fixes: 8764c4ca

 ("gpio: em: use the managed version of gpiochip_add_data()")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
parent 89fea04c
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment