diff options
author | Arvind Yadav <arvind.yadav.cs@gmail.com> | 2017-11-17 12:31:11 -0800 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2021-09-05 19:48:07 -0700 |
commit | daf87bffd02e35387a62c77eb32337c934cf631a (patch) | |
tree | a8c101f87c63b563491209ede5e4962c4857a64f /drivers/input/misc | |
parent | d5f9c43d41effc3c884e0139ca52015e451039b1 (diff) | |
download | linux-stable-daf87bffd02e35387a62c77eb32337c934cf631a.tar.gz linux-stable-daf87bffd02e35387a62c77eb32337c934cf631a.tar.bz2 linux-stable-daf87bffd02e35387a62c77eb32337c934cf631a.zip |
Input: palmas-pwrbutton - handle return value of platform_get_irq()
platform_get_irq() can fail here and we must check its return value.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/misc')
-rw-r--r-- | drivers/input/misc/palmas-pwrbutton.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/input/misc/palmas-pwrbutton.c b/drivers/input/misc/palmas-pwrbutton.c index 1e1baed63929..f9b05cf09ff5 100644 --- a/drivers/input/misc/palmas-pwrbutton.c +++ b/drivers/input/misc/palmas-pwrbutton.c @@ -210,6 +210,11 @@ static int palmas_pwron_probe(struct platform_device *pdev) INIT_DELAYED_WORK(&pwron->input_work, palmas_power_button_work); pwron->irq = platform_get_irq(pdev, 0); + if (pwron->irq < 0) { + error = pwron->irq; + goto err_free_input; + } + error = request_threaded_irq(pwron->irq, NULL, pwron_irq, IRQF_TRIGGER_HIGH | IRQF_TRIGGER_LOW | |