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: d3dc6e2322 ("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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
8d5c1c0397
commit
a99b9c82bd
@@ -148,6 +148,9 @@ static int imx_snvs_pwrkey_probe(struct platform_device *pdev)
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pdata->input = input;
|
||||||
|
platform_set_drvdata(pdev, pdata);
|
||||||
|
|
||||||
error = devm_request_irq(&pdev->dev, pdata->irq,
|
error = devm_request_irq(&pdev->dev, pdata->irq,
|
||||||
imx_snvs_pwrkey_interrupt,
|
imx_snvs_pwrkey_interrupt,
|
||||||
0, pdev->name, pdev);
|
0, pdev->name, pdev);
|
||||||
@@ -163,9 +166,6 @@ static int imx_snvs_pwrkey_probe(struct platform_device *pdev)
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
pdata->input = input;
|
|
||||||
platform_set_drvdata(pdev, pdata);
|
|
||||||
|
|
||||||
device_init_wakeup(&pdev->dev, pdata->wakeup);
|
device_init_wakeup(&pdev->dev, pdata->wakeup);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user