aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/cifs/netmisc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/cifs/netmisc.c b/fs/cifs/netmisc.c
index abae6dd2c6b9..cc88f4f0325e 100644
--- a/fs/cifs/netmisc.c
+++ b/fs/cifs/netmisc.c
@@ -980,10 +980,10 @@ struct timespec cnvrtDosUnixTm(__le16 le_date, __le16 le_time, int offset)
980 cifs_dbg(VFS, "illegal hours %d\n", st->Hours); 980 cifs_dbg(VFS, "illegal hours %d\n", st->Hours);
981 days = sd->Day; 981 days = sd->Day;
982 month = sd->Month; 982 month = sd->Month;
983 if ((days > 31) || (month > 12)) { 983 if (days < 1 || days > 31 || month < 1 || month > 12) {
984 cifs_dbg(VFS, "illegal date, month %d day: %d\n", month, days); 984 cifs_dbg(VFS, "illegal date, month %d day: %d\n", month, days);
985 if (month > 12) 985 days = clamp(days, 1, 31);
986 month = 12; 986 month = clamp(month, 1, 12);
987 } 987 }
988 month -= 1; 988 month -= 1;
989 days += total_days_of_prev_months[month]; 989 days += total_days_of_prev_months[month];