Module Name: src
Committed By: skrll
Date: Tue Mar 1 14:45:10 UTC 2016
Modified Files:
src/sys/external/bsd/dwc2 [nick-nhusb]: dwc2.c
Log Message:
Re-initialise dwc2_urb->packet_count after the memset(dwc2_urb, 0, ...)
To generate a diff of this commit:
cvs rdiff -u -r1.32.2.19 -r1.32.2.20 src/sys/external/bsd/dwc2/dwc2.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/external/bsd/dwc2/dwc2.c
diff -u src/sys/external/bsd/dwc2/dwc2.c:1.32.2.19 src/sys/external/bsd/dwc2/dwc2.c:1.32.2.20
--- src/sys/external/bsd/dwc2/dwc2.c:1.32.2.19 Tue Mar 1 14:38:47 2016
+++ src/sys/external/bsd/dwc2/dwc2.c Tue Mar 1 14:45:10 2016
@@ -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 @@ dwc2_device_start(struct usbd_xfer *xfer
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);