svn commit: r190488 - head/sys/dev/ed

Warner Losh imp at FreeBSD.org
Fri Mar 27 23:22:12 PDT 2009


Author: imp
Date: Sat Mar 28 06:22:11 2009
New Revision: 190488
URL: http://svn.freebsd.org/changeset/base/190488

Log:
  When reading via memory, read in (amount + 1) / 2 (to properly round
  up) rather than amount + 1 / 2, which is the same as amount, or 2x too
  many words which leads to data corruption.
  
  # This fixes the sbdrop panics I was seeing with the Toshiba LANCT00A.

Modified:
  head/sys/dev/ed/if_ed.c

Modified: head/sys/dev/ed/if_ed.c
==============================================================================
--- head/sys/dev/ed/if_ed.c	Sat Mar 28 06:12:39 2009	(r190487)
+++ head/sys/dev/ed/if_ed.c	Sat Mar 28 06:22:11 2009	(r190488)
@@ -1311,7 +1311,7 @@ ed_shmem_readmem16(struct ed_softc *sc, 
     uint16_t amount)
 {
 	bus_space_read_region_2(sc->mem_bst, sc->mem_bsh, src, (uint16_t *)dst,
-	    amount + 1 / 2);
+	    (amount + 1) / 2);
 }
 
 /*


More information about the svn-src-all mailing list