PERFORCE change 105309 for review

Hans Petter Selasky hselasky at FreeBSD.org
Wed Aug 30 07:14:46 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=105309

Change 105309 by hselasky at hselasky_mini_itx on 2006/08/30 07:13:44

	Zero alignment memory.

Affected files ...

.. //depot/projects/usb/src/sys/dev/usb/if_kue.c#5 edit

Differences ...

==== //depot/projects/usb/src/sys/dev/usb/if_kue.c#5 (text+ko) ====

@@ -796,6 +796,7 @@
 	struct kue_softc *sc = xfer->priv_sc;
 	struct ifnet *ifp = sc->sc_ifp;
 	struct mbuf *m;
+	u_int32_t total_len;
 	u_int8_t buf[2];
 
 	USBD_CHECK_STATUS(xfer);
@@ -838,7 +839,7 @@
 	}
 
 	xfer->length = (m->m_pkthdr.len + 2);
-	xfer->length += (64 - (xfer->length % 64));
+	total_len = (xfer->length + (64 - (xfer->length % 64)));
 
 	/* the first two bytes are the frame length */
 
@@ -850,6 +851,11 @@
 	usbd_m_copy_in(&(xfer->buf_data), 2, 
 		       m, 0, m->m_pkthdr.len);
 
+	usbd_bzero(&(xfer->buf_data), xfer->length,
+		   total_len - xfer->length);
+
+	xfer->length = total_len;
+
 	/*
 	 * if there's a BPF listener, bounce a copy 
 	 * of this frame to him:


More information about the p4-projects mailing list