Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4b07ae9b9d7b05a63e3ece32a666041949b7f421
Commit:     4b07ae9b9d7b05a63e3ece32a666041949b7f421
Parent:     8d0a6e4da5ecde2022025ee764e4f7e425a53770
Author:     Li Zefan <[EMAIL PROTECTED]>
AuthorDate: Tue Nov 6 13:40:39 2007 -0800
Committer:  Tony Luck <[EMAIL PROTECTED]>
CommitDate: Tue Nov 6 13:40:39 2007 -0800

    [IA64] Wrong args to memset in efi_gettimeofday()
    
    Not sizeof(ptr) ... we meant to say sizeof(*ptr).
    
    Also moved the memset to the error path (the normal path overwrites
    every field in the structure anyway) -Tony
    
    Signed-off-by: Li Zefan <[EMAIL PROTECTED]>
    Signed-off-by: Tony Luck <[EMAIL PROTECTED]>
---
 arch/ia64/kernel/efi.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c
index 6216eba..5181bf5 100644
--- a/arch/ia64/kernel/efi.c
+++ b/arch/ia64/kernel/efi.c
@@ -218,9 +218,10 @@ efi_gettimeofday (struct timespec *ts)
 {
        efi_time_t tm;
 
-       memset(ts, 0, sizeof(ts));
-       if ((*efi.get_time)(&tm, NULL) != EFI_SUCCESS)
+       if ((*efi.get_time)(&tm, NULL) != EFI_SUCCESS) {
+               memset(ts, 0, sizeof(*ts));
                return;
+       }
 
        ts->tv_sec = mktime(tm.year, tm.month, tm.day, tm.hour, tm.minute, 
tm.second);
        ts->tv_nsec = tm.nanosecond;
-
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

Reply via email to