Skip to contentSkip to conversation

Fix 2.4 EFI RTC oops

PATCH New Bjorn Helgaas 1 participant 1 message Dec 17, 2003 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix 2.4 EFI RTC oops

This recent change to 2.4:

	[email protected], 2003-12-10 18:30:50-02:00, [email protected]
	  [PATCH] Fix rtc leak

	  ===== arch/cris/drivers/ds1302.c 1.6 vs edited =====

broke efirtc.c (it causes a null pointer dereference on ia64). The fix is below. Please apply.

Bjorn

P.S. The changeset above doesn't appear to be in 2.6 yet. If/when you submit it for 2.6, you might consider using this style:

	memset(&wtime, 0, sizeof(wtime));
	memset(wtime, 0, sizeof(*wtime));

which is more obviously correct than:

	memset(&wtime, 0, sizeof(struct rtc_time));
	memset(wtime, 0, sizeof(struct rtc_time));

===== drivers/char/efirtc.c 1.6 vs edited =====

drivers/char/efirtc.c +1 -1
@@ -118,7 +118,7 @@
 static void
 convert_from_efi_time(efi_time_t *eft, struct rtc_time *wtime)
 {
-	memset(&wtime, 0, sizeof(struct rtc_time));
+	memset(wtime, 0, sizeof(struct rtc_time));
 	wtime->tm_sec  = eft->second;
 	wtime->tm_min  = eft->minute;
 	wtime->tm_hour = eft->hour;