summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/rtc/class.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c
index 356707be2f..e87f5f7b3e 100644
--- a/drivers/rtc/class.c
+++ b/drivers/rtc/class.c
@@ -46,6 +46,9 @@ EXPORT_SYMBOL(rtc_read_time);
int rtc_set_time(struct rtc_device *rtc, struct rtc_time *tm)
{
+ if (rtc_valid_tm(tm))
+ return -EINVAL;
+
return rtc->ops->set_time(rtc, tm);
}
EXPORT_SYMBOL(rtc_set_time);