Commit 131c9cc8 authored by Alessandro Zummo's avatar Alessandro Zummo Committed by Linus Torvalds

rtc: verify a critical argument to rtc_update_irq() before using it

This small addition to the core simplifies code in the drivers and makes
them more robust when handling shared IRQs.
Signed-off-by: default avatarAlessandro Zummo <a.zummo@towertech.it>
Cc: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c93a3ae2
...@@ -584,6 +584,9 @@ enum hrtimer_restart rtc_pie_update_irq(struct hrtimer *timer) ...@@ -584,6 +584,9 @@ enum hrtimer_restart rtc_pie_update_irq(struct hrtimer *timer)
void rtc_update_irq(struct rtc_device *rtc, void rtc_update_irq(struct rtc_device *rtc,
unsigned long num, unsigned long events) unsigned long num, unsigned long events)
{ {
if (unlikely(IS_ERR_OR_NULL(rtc)))
return;
pm_stay_awake(rtc->dev.parent); pm_stay_awake(rtc->dev.parent);
schedule_work(&rtc->irqwork); schedule_work(&rtc->irqwork);
} }
......
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