aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-parisc
diff options
context:
space:
mode:
authorKyle McMartin <kyle@shortfin.cabal.ca>2007-10-20 16:23:00 -0400
committerKyle McMartin <kyle@shortfin.cabal.ca>2007-10-20 16:23:00 -0400
commit7210c678202bb3107085bffeb63f66a9b8ba1c85 (patch)
tree522752089cb90b8aa6fc92d9c82caca8b7946810 /include/asm-parisc
parent562d139cc587fc7f7fb8e07aad13cdd2a412c9a7 (diff)
[PARISC] fix uninitialized variable warning in asm/rtc.h
get_rtc_time, in the case that PDC returns that the battery is bad, returns an unmodified rtc_time arg to the caller, which then uses uninitialized values. Fix this by memset-ing the arg with zeroes, so it will at least be cleared if we return failure. Spotted by John David Anglin. Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
Diffstat (limited to 'include/asm-parisc')
-rw-r--r--include/asm-parisc/rtc.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/asm-parisc/rtc.h b/include/asm-parisc/rtc.h
index f4ebff11dcbd..099d641a42c2 100644
--- a/include/asm-parisc/rtc.h
+++ b/include/asm-parisc/rtc.h
@@ -50,10 +50,10 @@ static inline unsigned int get_rtc_time(struct rtc_time *wtime)
50 long int days, rem, y; 50 long int days, rem, y;
51 const unsigned short int *ip; 51 const unsigned short int *ip;
52 52
53 if(pdc_tod_read(&tod_data) < 0) 53 memset(wtime, 0, sizeof(*wtime));
54 if (pdc_tod_read(&tod_data) < 0)
54 return RTC_24H | RTC_BATT_BAD; 55 return RTC_24H | RTC_BATT_BAD;
55 56
56
57 // most of the remainder of this function is: 57 // most of the remainder of this function is:
58// Copyright (C) 1991, 1993, 1997, 1998 Free Software Foundation, Inc. 58// Copyright (C) 1991, 1993, 1997, 1998 Free Software Foundation, Inc.
59// This was originally a part of the GNU C Library. 59// This was originally a part of the GNU C Library.