Module Name:    src
Committed By:   pgoyette
Date:           Tue Jun 29 04:42:30 UTC 2010

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

Log Message:
Fix logic error in detecting length of DDR3 SPD covered by CRC check.

Reported by Jonathan Gray in private email - thanks!


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/ic/spdmem.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/spdmem.c
diff -u src/sys/dev/ic/spdmem.c:1.1 src/sys/dev/ic/spdmem.c:1.2
--- src/sys/dev/ic/spdmem.c:1.1	Wed Mar 24 00:31:41 2010
+++ src/sys/dev/ic/spdmem.c	Tue Jun 29 04:42:30 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: spdmem.c,v 1.1 2010/03/24 00:31:41 pgoyette Exp $ */
+/* $NetBSD: spdmem.c,v 1.2 2010/06/29 04:42:30 pgoyette Exp $ */
 
 /*
  * Copyright (c) 2007 Nicolas Joly
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: spdmem.c,v 1.1 2010/03/24 00:31:41 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spdmem.c,v 1.2 2010/06/29 04:42:30 pgoyette Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -177,7 +177,7 @@
 	/* For DDR3 and FBDIMM, verify the CRC */
 	else if (spd_type <= SPDMEM_MEMTYPE_DDR3SDRAM) {
 		spd_len = (sc->sc_read)(sc, 0);
-		if (spd_len && SPDMEM_SPDCRC_116)
+		if (spd_len & SPDMEM_SPDCRC_116)
 			spd_crc_cover = 116;
 		else
 			spd_crc_cover = 125;

Reply via email to