summaryrefslogtreecommitdiffstats
path: root/fs/cifs/netmisc.c
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2007-10-17 21:31:52 +0000
committerSteve French <sfrench@us.ibm.com>2007-10-17 21:31:52 +0000
commitd5d18501090179d557a4ca976d1c30bfaf5de091 (patch)
tree95775567aa85bf5bf2fa3ee8bf743b4d17b0152a /fs/cifs/netmisc.c
parentc18c732ec6bf372aa959ca6534cbfc32e464defd (diff)
downloadlinux-d5d18501090179d557a4ca976d1c30bfaf5de091.tar.gz
linux-d5d18501090179d557a4ca976d1c30bfaf5de091.tar.bz2
linux-d5d18501090179d557a4ca976d1c30bfaf5de091.zip
[CIFS] Fix minor problems noticed by scan
Coverity scan pointed out some minor possible errors. Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/netmisc.c')
-rw-r--r--fs/cifs/netmisc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/cifs/netmisc.c b/fs/cifs/netmisc.c
index 2bfed3f45d0f..9ae4941cd61d 100644
--- a/fs/cifs/netmisc.c
+++ b/fs/cifs/netmisc.c
@@ -899,8 +899,11 @@ struct timespec cnvrtDosUnixTm(__u16 date, __u16 time)
cERROR(1, ("illegal hours %d", st->Hours));
days = sd->Day;
month = sd->Month;
- if ((days > 31) || (month > 12))
+ if ((days > 31) || (month > 12)) {
cERROR(1, ("illegal date, month %d day: %d", month, days));
+ if (month > 12)
+ month = 12;
+ }
month -= 1;
days += total_days_of_prev_months[month];
days += 3652; /* account for difference in days between 1980 and 1970 */