Module Name:    src
Committed By:   christos
Date:           Fri Feb  3 04:03:11 UTC 2012

Modified Files:
        src/sys/dev/ic: tpm.c

Log Message:
don't try to write in a const buffer.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/ic/tpm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/tpm.c
diff -u src/sys/dev/ic/tpm.c:1.4 src/sys/dev/ic/tpm.c:1.5
--- src/sys/dev/ic/tpm.c:1.4	Sun Jan 22 23:12:26 2012
+++ src/sys/dev/ic/tpm.c	Thu Feb  2 23:03:11 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: tpm.c,v 1.4 2012/01/23 04:12:26 christos Exp $	*/
+/*	$NetBSD: tpm.c,v 1.5 2012/02/03 04:03:11 christos Exp $	*/
 /*
  * Copyright (c) 2008, 2009 Michael Shalayeff
  * Copyright (c) 2009, 2010 Hans-Jörg Höxer
@@ -18,9 +18,9 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tpm.c,v 1.4 2012/01/23 04:12:26 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tpm.c,v 1.5 2012/02/03 04:03:11 christos Exp $");
 
-#if 0
+#if 1
 #define	TPM_DEBUG 
 #define aprint_debug_dev aprint_error_dev
 #endif
@@ -323,12 +323,13 @@ tpm_suspend(device_t dev, const pmf_qual
 	    0, 0, 0, 10,	/* Length in bytes */
 	    0, 0, 0, 156	/* TPM_ORD_SaveStates */
 	};
+	uint8_t scratch[sizeof(command)];
 
 	/*
 	 * Power down:  We have to issue the SaveStates command.
 	 */
 	(*sc->sc_write)(sc, &command, sizeof(command));
-	(*sc->sc_read)(sc, &command, sizeof(command), NULL, TPM_HDRSIZE);
+	(*sc->sc_read)(sc, &scratch, sizeof(scratch), NULL, TPM_HDRSIZE);
 #ifdef TPM_DEBUG
 	aprint_debug_dev(sc->sc_dev, "%s: power down\n", __func__);
 #endif

Reply via email to