Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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);
}