mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 14:42:37 +02:00
rtc: HYM8563: don't call rtc_year_days
If i2c error, the driver may call rtc_year_days with month -1, which will cause crash. Fix this by never call rtc_year_days at all. Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
This commit is contained in:
parent
29dc0928ee
commit
9a742e52b1
|
|
@ -227,7 +227,6 @@ static int hym8563_read_datetime(struct i2c_client *client, struct rtc_time *tm)
|
|||
else
|
||||
tm->tm_year += 2000;
|
||||
|
||||
tm->tm_yday = rtc_year_days(tm->tm_mday, tm->tm_mon, tm->tm_year);
|
||||
tm->tm_year -= 1900; //inorder to cooperate the systerm time
|
||||
if(tm->tm_year < 0)
|
||||
tm->tm_year = 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user