Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/nick-nhusb]: src/sys/external/bsd/dwc2 Re-initialise dwc2_urb->packet_co...



details:   https://anonhg.NetBSD.org/src/rev/df38f94590fd
branches:  nick-nhusb
changeset: 334425:df38f94590fd
user:      skrll <skrll%NetBSD.org@localhost>
date:      Tue Mar 01 14:45:10 2016 +0000

description:
Re-initialise dwc2_urb->packet_count after the memset(dwc2_urb, 0, ...)

diffstat:

 sys/external/bsd/dwc2/dwc2.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (31 lines):

diff -r e47f544a6c9f -r df38f94590fd sys/external/bsd/dwc2/dwc2.c
--- a/sys/external/bsd/dwc2/dwc2.c      Tue Mar 01 14:38:47 2016 +0000
+++ b/sys/external/bsd/dwc2/dwc2.c      Tue Mar 01 14:45:10 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dwc2.c,v 1.32.2.19 2016/03/01 14:38:47 skrll Exp $     */
+/*     $NetBSD: dwc2.c,v 1.32.2.20 2016/03/01 14:45:10 skrll Exp $     */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.32.2.19 2016/03/01 14:38:47 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.32.2.20 2016/03/01 14:45:10 skrll Exp $");
 
 #include "opt_usb.h"
 
@@ -1053,10 +1053,12 @@
        if (!dwc2_urb)
                    return USBD_NOMEM;
 
+       KASSERT(dwc2_urb->packet_count == xfer->ux_nframes);
        memset(dwc2_urb, 0, sizeof(*dwc2_urb) +
            sizeof(dwc2_urb->iso_descs[0]) * dwc2_urb->packet_count);
 
        dwc2_urb->priv = xfer;
+       dwc2_urb->packet_count = xfer->ux_nframes;
 
        dwc2_hcd_urb_set_pipeinfo(hsotg, dwc2_urb, addr, epnum, xfertype, dir,
                                  mps);



Home | Main Index | Thread Index | Old Index