Input: snvs_pwrkey - initialize necessary driver data before enabling IRQ
authorAnson Huang <anson.huang@nxp.com>
Wed, 3 Apr 2019 22:14:44 +0000 (15:14 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 May 2019 05:21:53 +0000 (07:21 +0200)
commita99b9c82bde6c3839457b3318cc5b207e8cc4c23
tree6c62acb292f6a09b65a49359e10348e7e70e5edb
parent8d5c1c03970872d4a9abd1658923524e11068a5a
Input: snvs_pwrkey - initialize necessary driver data before enabling IRQ

commit bf2a7ca39fd3ab47ef71c621a7ee69d1813b1f97 upstream.

SNVS IRQ is requested before necessary driver data initialized,
if there is a pending IRQ during driver probe phase, kernel
NULL pointer panic will occur in IRQ handler. To avoid such
scenario, just initialize necessary driver data before enabling
IRQ. This patch is inspired by NXP's internal kernel tree.

Fixes: d3dc6e232215 ("input: keyboard: imx: add snvs power key driver")
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/input/keyboard/snvs_pwrkey.c