Unverified Commit a6a98ae1 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!14742 rtc: check if __rtc_read_time was successful in rtc_timer_do_work()

parents a1ae6400 5bf2b41d
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -908,13 +908,18 @@ void rtc_timer_do_work(struct work_struct *work)
	struct timerqueue_node *next;
	ktime_t now;
	struct rtc_time tm;
	int err;

	struct rtc_device *rtc =
		container_of(work, struct rtc_device, irqwork);

	mutex_lock(&rtc->ops_lock);
again:
	__rtc_read_time(rtc, &tm);
	err = __rtc_read_time(rtc, &tm);
	if (err) {
		mutex_unlock(&rtc->ops_lock);
		return;
	}
	now = rtc_tm_to_ktime(tm);
	while ((next = timerqueue_getnext(&rtc->timerqueue))) {
		if (next->expires > now)