Date: Wed, 30 Aug 2006 07:14:45 GMT From: Hans Petter Selasky <hselasky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 105309 for review Message-ID: <200608300714.k7U7EjxE022998@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=105309 Change 105309 by hselasky@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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200608300714.k7U7EjxE022998>