]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
gpio: Fix potential NULL handler data in chained irqchip handler
authorJarkko Nikula <jarkko.nikula@linux.intel.com>
Tue, 16 Sep 2014 13:23:15 +0000 (16:23 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 5 Oct 2014 20:41:06 +0000 (13:41 -0700)
commit02a4c4965393b98347f14947fa8d02aeab94be77
treeafd61b20a1fa41d022c2acf11f98bd5298b34264
parent47155f7c6488dbc3bdb350dbec582037acb7c20d
gpio: Fix potential NULL handler data in chained irqchip handler

commit 324b0398781e7afb846378dd2d8a4374faaf236b upstream.

There is possibility with misconfigured pins that interrupt occurs instantly
after setting irq_set_chained_handler() in gpiochip_set_chained_irqchip().
Now if handler gets called before irq_set_handler_data() the handler gets
NULL handler data.

Fix this by moving irq_set_handler_data() call before
irq_set_chained_handler() in gpiochip_set_chained_irqchip().

Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpio/gpiolib.c