rtc-lib: Check tm_wday for validity in rtc_valid_tm()
RTC drivers rely on rtc_valid_tm() in order to make sure that no bogus
values from uninitialized HW registers get passed to the uppper layers.

A somewhat contrived way to reproduce this problem with DS1307 RTC
would be to do the following:

> i2c_write -b <bus> -a <addr> -r 3 0x00
> hwclock

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent 304cdde commit 645320b94aaa0f478d31809673df6f83964c5292
@Andrey Smirnov Andrey Smirnov authored on 7 Jan 2016
Sascha Hauer committed on 7 Jan 2016
Showing 1 changed file
View
drivers/rtc/rtc-lib.c