]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/rtc/rtc-cmos.c
rtc: fix the error in the function of cmos_set_alarm
[linux-2.6-omap-h63xx.git] / drivers / rtc / rtc-cmos.c
index b48517021ee62e71e87f1cbefa408a65ed9ced0c..dcdc142a3441114ccc9a5446496af48a4746d704 100644 (file)
@@ -198,9 +198,8 @@ static int cmos_set_alarm(struct device *dev, struct rtc_wkalrm *t)
 
        /* Writing 0xff means "don't care" or "match all".  */
 
-       mon = t->time.tm_mon;
-       mon = (mon < 12) ? BIN2BCD(mon) : 0xff;
-       mon++;
+       mon = t->time.tm_mon + 1;
+       mon = (mon <= 12) ? BIN2BCD(mon) : 0xff;
 
        mday = t->time.tm_mday;
        mday = (mday >= 1 && mday <= 31) ? BIN2BCD(mday) : 0xff;