[PATCH 3/7] rtc: Check time for validity before passing it to the rtc driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



So that rtc drivers do not get invalid times.

Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
---
 drivers/rtc/class.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c
index 356707b..e87f5f7 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);
-- 
2.6.2


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux