The patch titled rtc: properly handle rtc_read_alarm error propagation and fix bug has been removed from the -mm tree. Its filename was rtc-properly-handle-rtc_read_alarm-error-propagation-and-fix-bug.patch This patch was dropped because it was merged into mainline or a subsystem tree The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: rtc: properly handle rtc_read_alarm error propagation and fix bug From: John Stultz <john.stultz@xxxxxxxxxx> In reviewing cases where the virtualized interfaces didn't propagate errors properly, I noticed rtc_read_alarm needed fixing. In doing so I noticed my RTC rework dropped a memset and that the behavior of rtc_read_alarm shouldn't be conditionalized on the alarm.enabled flag (as the alarm may be set, but the irqs may be disabled). So those were corrected as well. Signed-off-by: John Stultz <john.stultz@xxxxxxxxxx> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx> Cc: Alessandro Zummo <a.zummo@xxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/rtc/interface.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff -puN drivers/rtc/interface.c~rtc-properly-handle-rtc_read_alarm-error-propagation-and-fix-bug drivers/rtc/interface.c --- a/drivers/rtc/interface.c~rtc-properly-handle-rtc_read_alarm-error-propagation-and-fix-bug +++ a/drivers/rtc/interface.c @@ -123,12 +123,18 @@ int rtc_read_alarm(struct rtc_device *rt err = mutex_lock_interruptible(&rtc->ops_lock); if (err) return err; - alarm->enabled = rtc->aie_timer.enabled; - if (alarm->enabled) + if (rtc->ops == NULL) + err = -ENODEV; + else if (!rtc->ops->read_alarm) + err = -EINVAL; + else { + memset(alarm, 0, sizeof(struct rtc_wkalrm)); + alarm->enabled = rtc->aie_timer.enabled; alarm->time = rtc_ktime_to_tm(rtc->aie_timer.node.expires); + } mutex_unlock(&rtc->ops_lock); - return 0; + return err; } EXPORT_SYMBOL_GPL(rtc_read_alarm); _ Patches currently in -mm which might be from john.stultz@xxxxxxxxxx are origin.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html