mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-12 05:48:39 +08:00
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: Alessandro Zummo <a.zummo@towertech.it> Cc: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
c93a3ae2d2
commit
131c9cc832
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user