Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7210c678202bb3107085bffeb63f66a9b8ba1c85 Commit: 7210c678202bb3107085bffeb63f66a9b8ba1c85 Parent: 562d139cc587fc7f7fb8e07aad13cdd2a412c9a7 Author: Kyle McMartin <[EMAIL PROTECTED]> AuthorDate: Sat Oct 20 13:23:00 2007 -0700 Committer: Kyle McMartin <[EMAIL PROTECTED]> CommitDate: Sat Oct 20 13:23:00 2007 -0700
[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 <[EMAIL PROTECTED]> --- include/asm-parisc/rtc.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/asm-parisc/rtc.h b/include/asm-parisc/rtc.h index f4ebff1..099d641 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) long int days, rem, y; const unsigned short int *ip; - if(pdc_tod_read(&tod_data) < 0) + memset(wtime, 0, sizeof(*wtime)); + if (pdc_tod_read(&tod_data) < 0) return RTC_24H | RTC_BATT_BAD; - // most of the remainder of this function is: // Copyright (C) 1991, 1993, 1997, 1998 Free Software Foundation, Inc. // This was originally a part of the GNU C Library. - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html