# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1272 -> 1.1273 # arch/m68k/bvme6000/rtc.c 1.6 -> 1.7 # drivers/char/mips_rtc.c 1.1 -> 1.2 # drivers/sbus/char/rtc.c 1.8 -> 1.9 # drivers/char/ds1286.c 1.9 -> 1.10 # drivers/char/rtc.c 1.14 -> 1.15 # drivers/char/ip27-rtc.c 1.5 -> 1.6 # arch/cris/drivers/pcf8563.c 1.3 -> 1.4 # drivers/hil/hp_sdc_rtc.c 1.2 -> 1.3 # drivers/char/efirtc.c 1.5 -> 1.6 # arch/cris/drivers/ds1302.c 1.6 -> 1.7 # drivers/macintosh/rtc.c 1.6 -> 1.7 # drivers/acorn/char/i2c.c 1.3 -> 1.4 # arch/ppc64/kernel/rtc.c 1.2 -> 1.3 # arch/m68k/mvme16x/rtc.c 1.4 -> 1.5 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/12/10 trini@mvista.com 1.1273 # [PATCH] Fix rtc leak # # ===== arch/cris/drivers/ds1302.c 1.6 vs edited ===== # -------------------------------------------- # diff -Nru a/arch/cris/drivers/ds1302.c b/arch/cris/drivers/ds1302.c --- a/arch/cris/drivers/ds1302.c Thu Dec 11 15:02:43 2003 +++ b/arch/cris/drivers/ds1302.c Thu Dec 11 15:02:43 2003 @@ -346,6 +346,7 @@ { struct rtc_time rtc_tm; + memset(&rtc_tm, 0, sizeof (struct rtc_time)); get_rtc_time(&rtc_tm); if (copy_to_user((struct rtc_time*)arg, &rtc_tm, sizeof(struct rtc_time))) return -EFAULT; diff -Nru a/arch/cris/drivers/pcf8563.c b/arch/cris/drivers/pcf8563.c --- a/arch/cris/drivers/pcf8563.c Thu Dec 11 15:02:43 2003 +++ b/arch/cris/drivers/pcf8563.c Thu Dec 11 15:02:43 2003 @@ -220,6 +220,7 @@ { struct rtc_time tm; + memset(&tm, 0, sizeof (struct rtc_time)); get_rtc_time(&tm); if (copy_to_user((struct rtc_time *) arg, &tm, sizeof tm)) { diff -Nru a/arch/m68k/bvme6000/rtc.c b/arch/m68k/bvme6000/rtc.c --- a/arch/m68k/bvme6000/rtc.c Thu Dec 11 15:02:43 2003 +++ b/arch/m68k/bvme6000/rtc.c Thu Dec 11 15:02:43 2003 @@ -54,6 +54,7 @@ /* Ensure clock and real-time-mode-register are accessible */ msr = rtc->msr & 0xc0; rtc->msr = 0x40; + memset(&wtime, 0, sizeof(struct rtc_time)); do { wtime.tm_sec = BCD2BIN(rtc->bcd_sec); wtime.tm_min = BCD2BIN(rtc->bcd_min); diff -Nru a/arch/m68k/mvme16x/rtc.c b/arch/m68k/mvme16x/rtc.c --- a/arch/m68k/mvme16x/rtc.c Thu Dec 11 15:02:43 2003 +++ b/arch/m68k/mvme16x/rtc.c Thu Dec 11 15:02:43 2003 @@ -52,6 +52,7 @@ cli(); /* Ensure clock and real-time-mode-register are accessible */ rtc->ctrl = RTC_READ; + memset(&wtime, 0, sizeof(struct rtc_time)); wtime.tm_sec = BCD2BIN(rtc->bcd_sec); wtime.tm_min = BCD2BIN(rtc->bcd_min); wtime.tm_hour = BCD2BIN(rtc->bcd_hr); diff -Nru a/arch/ppc64/kernel/rtc.c b/arch/ppc64/kernel/rtc.c --- a/arch/ppc64/kernel/rtc.c Thu Dec 11 15:02:43 2003 +++ b/arch/ppc64/kernel/rtc.c Thu Dec 11 15:02:43 2003 @@ -96,6 +96,7 @@ switch (cmd) { case RTC_RD_TIME: /* Read the time/date from RTC */ { + memset(&wtime, 0, sizeof(struct rtc_time)); ppc_md.get_rtc_time(&wtime); break; } diff -Nru a/drivers/acorn/char/i2c.c b/drivers/acorn/char/i2c.c --- a/drivers/acorn/char/i2c.c Thu Dec 11 15:02:43 2003 +++ b/drivers/acorn/char/i2c.c Thu Dec 11 15:02:43 2003 @@ -166,6 +166,7 @@ break; case RTC_RD_TIME: + memset(&rtctm, 0, sizeof(struct rtc_time)); get_rtc_time(&rtc_raw, &year); rtctm.tm_sec = rtc_raw.secs; rtctm.tm_min = rtc_raw.mins; diff -Nru a/drivers/char/ds1286.c b/drivers/char/ds1286.c --- a/drivers/char/ds1286.c Thu Dec 11 15:02:43 2003 +++ b/drivers/char/ds1286.c Thu Dec 11 15:02:43 2003 @@ -173,7 +173,7 @@ * means "don't care" or "match all". Only the tm_hour, * tm_min, and tm_sec values are filled in. */ - + memset(&wtime, 0, sizeof(struct rtc_time)); ds1286_get_alm_time(&wtime); break; } @@ -216,6 +216,7 @@ } case RTC_RD_TIME: /* Read the time/date from RTC */ { + memset(&wtime, 0, sizeof(struct rtc_time)); ds1286_get_time(&wtime); break; } diff -Nru a/drivers/char/efirtc.c b/drivers/char/efirtc.c --- a/drivers/char/efirtc.c Thu Dec 11 15:02:43 2003 +++ b/drivers/char/efirtc.c Thu Dec 11 15:02:43 2003 @@ -118,6 +118,7 @@ static void convert_from_efi_time(efi_time_t *eft, struct rtc_time *wtime) { + memset(wtime, 0, sizeof(struct rtc_time)); wtime->tm_sec = eft->second; wtime->tm_min = eft->minute; wtime->tm_hour = eft->hour; diff -Nru a/drivers/char/ip27-rtc.c b/drivers/char/ip27-rtc.c --- a/drivers/char/ip27-rtc.c Thu Dec 11 15:02:43 2003 +++ b/drivers/char/ip27-rtc.c Thu Dec 11 15:02:43 2003 @@ -83,6 +83,7 @@ switch (cmd) { case RTC_RD_TIME: /* Read the time/date from RTC */ { + memset(&wtime, 0, sizeof(struct rtc_time)); get_rtc_time(&wtime); break; } diff -Nru a/drivers/char/mips_rtc.c b/drivers/char/mips_rtc.c --- a/drivers/char/mips_rtc.c Thu Dec 11 15:02:43 2003 +++ b/drivers/char/mips_rtc.c Thu Dec 11 15:02:43 2003 @@ -82,6 +82,7 @@ switch (cmd) { case RTC_RD_TIME: /* Read the time/date from RTC */ + memset(&rtc_tm, 0, sizeof(struct rtc_time)); curr_time = rtc_get_time(); to_tm(curr_time, &rtc_tm); rtc_tm.tm_year -= 1900; diff -Nru a/drivers/char/rtc.c b/drivers/char/rtc.c --- a/drivers/char/rtc.c Thu Dec 11 15:02:43 2003 +++ b/drivers/char/rtc.c Thu Dec 11 15:02:43 2003 @@ -376,7 +376,7 @@ * means "don't care" or "match all". Only the tm_hour, * tm_min, and tm_sec values are filled in. */ - + memset(&wtime, 0, sizeof(struct rtc_time)); get_rtc_alm_time(&wtime); break; } @@ -420,6 +420,7 @@ } case RTC_RD_TIME: /* Read the time/date from RTC */ { + memset(&wtime, 0, sizeof(struct rtc_time)); get_rtc_time(&wtime); break; } diff -Nru a/drivers/hil/hp_sdc_rtc.c b/drivers/hil/hp_sdc_rtc.c --- a/drivers/hil/hp_sdc_rtc.c Thu Dec 11 15:02:43 2003 +++ b/drivers/hil/hp_sdc_rtc.c Thu Dec 11 15:02:43 2003 @@ -561,6 +561,7 @@ } case RTC_ALM_READ: /* Read the present alarm time */ { + memset(&ttime, 0, sizeof(struct timeval)); if (hp_sdc_rtc_read_mt(&ttime)) return -EFAULT; break; } @@ -609,6 +610,7 @@ } case RTC_RD_TIME: /* Read the time/date from RTC */ { + memset(&wtime, 0, sizeof(struct rtc_time)); if (hp_sdc_rtc_read_bbrtc(&wtime)) return -EFAULT; break; } diff -Nru a/drivers/macintosh/rtc.c b/drivers/macintosh/rtc.c --- a/drivers/macintosh/rtc.c Thu Dec 11 15:02:43 2003 +++ b/drivers/macintosh/rtc.c Thu Dec 11 15:02:43 2003 @@ -64,6 +64,7 @@ case RTC_RD_TIME: if (ppc_md.get_rtc_time) { + memset(&rtc_tm, 0, sizeof(struct rtc_time)); get_rtc_time(&rtc_tm); if (copy_to_user((struct rtc_time*)arg, &rtc_tm, sizeof(struct rtc_time))) diff -Nru a/drivers/sbus/char/rtc.c b/drivers/sbus/char/rtc.c --- a/drivers/sbus/char/rtc.c Thu Dec 11 15:02:43 2003 +++ b/drivers/sbus/char/rtc.c Thu Dec 11 15:02:43 2003 @@ -89,6 +89,7 @@ switch (cmd) { case RTCGET: + memset(&rtc_tm, 0, sizeof(struct rtc_time)); get_rtc_time(&rtc_tm); if (copy_to_user((struct rtc_time*)arg, &rtc_tm, sizeof(struct rtc_time)))