Module Name:    src
Committed By:   martin
Date:           Tue Feb 25 18:52:44 UTC 2020

Modified Files:
        src/sys/arch/mips/adm5120/dev [netbsd-8]: ahci.c
        src/sys/dev/usb [netbsd-8]: ehci.c ohci.c uhci.c
        src/sys/external/bsd/dwc2 [netbsd-8]: dwc2.c

Log Message:
Pull up following revision(s) (requested by skrll in ticket #1507):

        sys/dev/usb/ohci.c: revision 1.296
        sys/dev/usb/uhci.c: revision 1.294
        sys/external/bsd/dwc2/dwc2.c: revision 1.72
        sys/arch/mips/adm5120/dev/ahci.c: revision 1.21
        sys/dev/usb/ehci.c: revision 1.274

Fix a memory leak.  Spotted by nat@


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.14.2.1 src/sys/arch/mips/adm5120/dev/ahci.c
cvs rdiff -u -r1.254.8.6 -r1.254.8.7 src/sys/dev/usb/ehci.c
cvs rdiff -u -r1.273.6.5 -r1.273.6.6 src/sys/dev/usb/ohci.c
cvs rdiff -u -r1.275.2.5 -r1.275.2.6 src/sys/dev/usb/uhci.c
cvs rdiff -u -r1.46.2.4 -r1.46.2.5 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/arch/mips/adm5120/dev/ahci.c
diff -u src/sys/arch/mips/adm5120/dev/ahci.c:1.14 src/sys/arch/mips/adm5120/dev/ahci.c:1.14.2.1
--- src/sys/arch/mips/adm5120/dev/ahci.c:1.14	Thu Jun  1 02:45:06 2017
+++ src/sys/arch/mips/adm5120/dev/ahci.c	Tue Feb 25 18:52:44 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahci.c,v 1.14 2017/06/01 02:45:06 chs Exp $	*/
+/*	$NetBSD: ahci.c,v 1.14.2.1 2020/02/25 18:52:44 martin Exp $	*/
 
 /*-
  * Copyright (c) 2007 Ruslan Ermilov and Vsevolod Lobko.
@@ -64,7 +64,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ahci.c,v 1.14 2017/06/01 02:45:06 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahci.c,v 1.14.2.1 2020/02/25 18:52:44 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -922,6 +922,9 @@ ahci_device_ctrl_start(struct usbd_xfer 
 
 	usb_transfer_complete(xfer);
 	mutex_exit(&sc->sc_lock);
+
+	usb_freemem(&sc->sc_bus, &reqdma);
+
 	return USBD_NORMAL_COMPLETION;
 }
 

Index: src/sys/dev/usb/ehci.c
diff -u src/sys/dev/usb/ehci.c:1.254.8.6 src/sys/dev/usb/ehci.c:1.254.8.7
--- src/sys/dev/usb/ehci.c:1.254.8.6	Fri Sep 28 08:33:43 2018
+++ src/sys/dev/usb/ehci.c	Tue Feb 25 18:52:44 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci.c,v 1.254.8.6 2018/09/28 08:33:43 martin Exp $ */
+/*	$NetBSD: ehci.c,v 1.254.8.7 2020/02/25 18:52:44 martin Exp $ */
 
 /*
  * Copyright (c) 2004-2012 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.254.8.6 2018/09/28 08:33:43 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.254.8.7 2020/02/25 18:52:44 martin Exp $");
 
 #include "ohci.h"
 #include "uhci.h"
@@ -3831,7 +3831,7 @@ Static void
 ehci_device_ctrl_close(struct usbd_pipe *pipe)
 {
 	ehci_softc_t *sc = EHCI_PIPE2SC(pipe);
-	/*struct ehci_pipe *epipe = EHCI_PIPE2EPIPE(pipe);*/
+	struct ehci_pipe * const epipe = EHCI_PIPE2EPIPE(pipe);
 
 	EHCIHIST_FUNC(); EHCIHIST_CALLED();
 
@@ -3840,6 +3840,8 @@ ehci_device_ctrl_close(struct usbd_pipe 
 	DPRINTF("pipe=%#jx", (uintptr_t)pipe, 0, 0, 0);
 
 	ehci_close_pipe(pipe, sc->sc_async_head);
+
+	usb_freemem(&sc->sc_bus, &epipe->ctrl.reqdma);
 }
 
 /*

Index: src/sys/dev/usb/ohci.c
diff -u src/sys/dev/usb/ohci.c:1.273.6.5 src/sys/dev/usb/ohci.c:1.273.6.6
--- src/sys/dev/usb/ohci.c:1.273.6.5	Mon Aug 12 17:19:02 2019
+++ src/sys/dev/usb/ohci.c	Tue Feb 25 18:52:44 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ohci.c,v 1.273.6.5 2019/08/12 17:19:02 martin Exp $	*/
+/*	$NetBSD: ohci.c,v 1.273.6.6 2020/02/25 18:52:44 martin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2004, 2005, 2012 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.273.6.5 2019/08/12 17:19:02 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.273.6.6 2020/02/25 18:52:44 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -2929,6 +2929,8 @@ ohci_device_ctrl_close(struct usbd_pipe 
 	DPRINTF("pipe=%#jx", (uintptr_t)pipe, 0, 0, 0);
 	ohci_close_pipe(pipe, sc->sc_ctrl_head);
 	ohci_free_std_locked(sc, opipe->tail.td);
+
+	usb_freemem(&sc->sc_bus, &opipe->ctrl.reqdma);
 }
 
 /************************/

Index: src/sys/dev/usb/uhci.c
diff -u src/sys/dev/usb/uhci.c:1.275.2.5 src/sys/dev/usb/uhci.c:1.275.2.6
--- src/sys/dev/usb/uhci.c:1.275.2.5	Thu Sep 27 14:52:26 2018
+++ src/sys/dev/usb/uhci.c	Tue Feb 25 18:52:44 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uhci.c,v 1.275.2.5 2018/09/27 14:52:26 martin Exp $	*/
+/*	$NetBSD: uhci.c,v 1.275.2.6 2020/02/25 18:52:44 martin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2004, 2011, 2012 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.275.2.5 2018/09/27 14:52:26 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.275.2.6 2020/02/25 18:52:44 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -2845,6 +2845,7 @@ uhci_device_ctrl_close(struct usbd_pipe 
 	uhci_free_std_locked(sc, upipe->ctrl.setup);
 	uhci_free_std_locked(sc, upipe->ctrl.stat);
 
+	usb_freemem(&sc->sc_bus, &upipe->ctrl.reqdma);
 }
 
 /* Abort a device interrupt request. */

Index: src/sys/external/bsd/dwc2/dwc2.c
diff -u src/sys/external/bsd/dwc2/dwc2.c:1.46.2.4 src/sys/external/bsd/dwc2/dwc2.c:1.46.2.5
--- src/sys/external/bsd/dwc2/dwc2.c:1.46.2.4	Thu Dec  5 16:59:35 2019
+++ src/sys/external/bsd/dwc2/dwc2.c	Tue Feb 25 18:52:44 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc2.c,v 1.46.2.4 2019/12/05 16:59:35 bouyer Exp $	*/
+/*	$NetBSD: dwc2.c,v 1.46.2.5 2020/02/25 18:52:44 martin Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.46.2.4 2019/12/05 16:59:35 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.46.2.5 2020/02/25 18:52:44 martin Exp $");
 
 #include "opt_usb.h"
 
@@ -773,9 +773,13 @@ dwc2_device_ctrl_abort(struct usbd_xfer 
 Static void
 dwc2_device_ctrl_close(struct usbd_pipe *pipe)
 {
+	struct dwc2_softc * const sc = DWC2_PIPE2SC(pipe);
+	struct dwc2_pipe * const dpipe = DWC2_PIPE2DPIPE(pipe);
 
 	DPRINTF("pipe=%p\n", pipe);
 	dwc2_close_pipe(pipe);
+
+	usb_freemem(&sc->sc_bus, &dpipe->req_dma);
 }
 
 Static void

Reply via email to