提交 131c9cc8 编写于 作者: A Alessandro Zummo 提交者: 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: NAlessandro Zummo <a.zummo@towertech.it>
Cc: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 c93a3ae2
......@@ -584,6 +584,9 @@ enum hrtimer_restart rtc_pie_update_irq(struct hrtimer *timer)
void rtc_update_irq(struct rtc_device *rtc,
unsigned long num, unsigned long events)
{
if (unlikely(IS_ERR_OR_NULL(rtc)))
return;
pm_stay_awake(rtc->dev.parent);
schedule_work(&rtc->irqwork);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册