[PATCH] powerpc: RTC memory corruption

Michael Neuling mikey at neuling.org
Tue Mar 14 17:11:51 EST 2006


We should be memset'ing the data we are pointing to, not the pointer
itself.  This is in an error path so we probably don't hit it much.

Signed-off-by: Michael Neuling <mikey at neuling.org>
---
 arch/powerpc/kernel/rtas-rtc.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6-powerpc-merge/arch/powerpc/kernel/rtas-rtc.c
===================================================================
--- linux-2.6-powerpc-merge.orig/arch/powerpc/kernel/rtas-rtc.c
+++ linux-2.6-powerpc-merge/arch/powerpc/kernel/rtas-rtc.c
@@ -52,7 +52,7 @@ void rtas_get_rtc_time(struct rtc_time *
 		error = rtas_call(rtas_token("get-time-of-day"), 0, 8, ret);
 		if (error == RTAS_CLOCK_BUSY || rtas_is_extended_busy(error)) {
 			if (in_interrupt() && printk_ratelimit()) {
-				memset(&rtc_tm, 0, sizeof(struct rtc_time));
+				memset(rtc_tm, 0, sizeof(struct rtc_time));
 				printk(KERN_WARNING "error: reading clock"
 				       " would delay interrupt\n");
 				return;	/* delay not allowed */



More information about the Linuxppc64-dev mailing list