Commit 7da83f1b authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Alexandre Belloni

rtc: da9063: Handle invalid IRQ from platform_get_irq_byname()

platform_get_irq_byname() might return -errno which later would be
cast to an unsigned int and used in request_irq().
Signed-off-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
Tested-by: default avatarAdam Thomson <Adam.Thomson.Opensource@diasemi.com>
Link: https://lore.kernel.org/r/20191004150510.6278-1-krzk@kernel.orgSigned-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent cf79e7c3
...@@ -483,6 +483,9 @@ static int da9063_rtc_probe(struct platform_device *pdev) ...@@ -483,6 +483,9 @@ static int da9063_rtc_probe(struct platform_device *pdev)
rtc->rtc_dev->uie_unsupported = 1; rtc->rtc_dev->uie_unsupported = 1;
irq_alarm = platform_get_irq_byname(pdev, "ALARM"); irq_alarm = platform_get_irq_byname(pdev, "ALARM");
if (irq_alarm < 0)
return irq_alarm;
ret = devm_request_threaded_irq(&pdev->dev, irq_alarm, NULL, ret = devm_request_threaded_irq(&pdev->dev, irq_alarm, NULL,
da9063_alarm_event, da9063_alarm_event,
IRQF_TRIGGER_LOW | IRQF_ONESHOT, IRQF_TRIGGER_LOW | IRQF_ONESHOT,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment