aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/kernel/efi.c
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2007-11-06 16:40:39 -0500
committerTony Luck <tony.luck@intel.com>2007-11-06 16:40:39 -0500
commit4b07ae9b9d7b05a63e3ece32a666041949b7f421 (patch)
tree62e78c1d22dc58aa21bcd00309df3675f4332d04 /arch/ia64/kernel/efi.c
parent8d0a6e4da5ecde2022025ee764e4f7e425a53770 (diff)
[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 <lizf@cn.fujitsu.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64/kernel/efi.c')
-rw-r--r--arch/ia64/kernel/efi.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c
index 6216eba2e38f..5181bf551f3c 100644
--- a/arch/ia64/kernel/efi.c
+++ b/arch/ia64/kernel/efi.c
@@ -218,9 +218,10 @@ efi_gettimeofday (struct timespec *ts)
218{ 218{
219 efi_time_t tm; 219 efi_time_t tm;
220 220
221 memset(ts, 0, sizeof(ts)); 221 if ((*efi.get_time)(&tm, NULL) != EFI_SUCCESS) {
222 if ((*efi.get_time)(&tm, NULL) != EFI_SUCCESS) 222 memset(ts, 0, sizeof(*ts));
223 return; 223 return;
224 }
224 225
225 ts->tv_sec = mktime(tm.year, tm.month, tm.day, tm.hour, tm.minute, tm.second); 226 ts->tv_sec = mktime(tm.year, tm.month, tm.day, tm.hour, tm.minute, tm.second);
226 ts->tv_nsec = tm.nanosecond; 227 ts->tv_nsec = tm.nanosecond;