]> git.baikalelectronics.ru Git - kernel.git/commit
gpio: pca953x: Fix dereference of irq data in shutdown
authorMark Walton <mark.walton@serialtek.com>
Thu, 28 Feb 2019 15:46:36 +0000 (15:46 +0000)
committerLinus Walleij <linus.walleij@linaro.org>
Fri, 1 Mar 2019 10:55:32 +0000 (11:55 +0100)
commit86eb4e13f97d16bcaa8fa709414b64b8185bd730
tree631dd23e990896936531e47f31e20e1f774b9402
parent64454c53b0e88a99a068e4e2bf33498896267e0b
gpio: pca953x: Fix dereference of irq data in shutdown

If a PCA953x gpio was used as an interrupt and then released,
the shutdown function was trying to extract the pca953x_chip
pointer directly from the irq_data, but in reality was getting
the gpio_chip structure.

The net effect was that the subsequent writes to the data
structure corrupted data in the gpio_chip structure, which wasn't
immediately obvious until attempting to use the GPIO again in the
future, at which point the kernel panics.

This fix correctly extracts the pca953x_chip structure via the
gpio_chip structure, as is correctly done in the other irq
functions.

Fixes: 09ef1cba3da4 ("gpio: pca953x: Clear irq trigger type on irq shutdown")
Cc: stable@vger.kernel.org
Signed-off-by: Mark Walton <mark.walton@serialtek.com>
Reviewed-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-pca953x.c