gpio: fix memory leak and sleep-while-atomic
authorJohan Hovold <johan@kernel.org>
Mon, 12 Jan 2015 16:12:27 +0000 (17:12 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 14 Jan 2015 13:25:48 +0000 (14:25 +0100)
commit00acc3dc248063f982cfacfbe5e78c0d6797ffef
treec60363d93215f8027e14bee371746ccb5d4431d2
parent05aa52033494a13178fb550660aea87cd8a99cfd
gpio: fix memory leak and sleep-while-atomic

Fix memory leak and sleep-while-atomic in gpiochip_remove.

The memory leak was introduced by afa82fab5e13 ("gpio / ACPI: Move event
handling registration to gpiolib irqchip helpers") that moved the
release of acpi interrupt resources to gpiochip_irqchip_remove, but by
then the resources are no longer accessible as the acpi_gpio_chip has
already been freed by acpi_gpiochip_remove.

Note that this also fixes a few potential sleep-while-atomics, which has
been around since 1425052097b5 ("gpio: add IRQ chip helpers in gpiolib")
when the call to gpiochip_irqchip_remove while holding a spinlock was
added (a couple of irq-domain paths can end up grabbing mutexes).

Fixes: afa82fab5e13 ("gpio / ACPI: Move event handling registration to
gpiolib irqchip helpers")
Fixes: 1425052097b5 ("gpio: add IRQ chip helpers in gpiolib")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpiolib.c
This page took 0.025084 seconds and 5 git commands to generate.