Source-Changes-HG archive

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

[src/netbsd-9]: src/sys Pull up following revision(s) (requested by skrll in ...



details:   https://anonhg.NetBSD.org/src/rev/c430af47dec1
branches:  netbsd-9
changeset: 745222:c430af47dec1
user:      martin <martin%NetBSD.org@localhost>
date:      Tue Feb 25 18:50:29 2020 +0000

description:
Pull up following revision(s) (requested by skrll in ticket #718):

        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@

diffstat:

 sys/arch/mips/adm5120/dev/ahci.c |  7 +++++--
 sys/dev/usb/ehci.c               |  8 +++++---
 sys/dev/usb/ohci.c               |  6 ++++--
 sys/dev/usb/uhci.c               |  5 +++--
 sys/external/bsd/dwc2/dwc2.c     |  8 ++++++--
 5 files changed, 23 insertions(+), 11 deletions(-)

diffs (149 lines):

diff -r 53ab91264a3c -r c430af47dec1 sys/arch/mips/adm5120/dev/ahci.c
--- a/sys/arch/mips/adm5120/dev/ahci.c  Tue Feb 25 18:40:43 2020 +0000
+++ b/sys/arch/mips/adm5120/dev/ahci.c  Tue Feb 25 18:50:29 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ahci.c,v 1.17 2019/02/17 04:17:52 rin Exp $    */
+/*     $NetBSD: ahci.c,v 1.17.4.1 2020/02/25 18:50:29 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.17 2019/02/17 04:17:52 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahci.c,v 1.17.4.1 2020/02/25 18:50:29 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -912,6 +912,9 @@
 
        usb_transfer_complete(xfer);
        mutex_exit(&sc->sc_lock);
+
+       usb_freemem(&sc->sc_bus, &reqdma);
+
        return USBD_NORMAL_COMPLETION;
 }
 
diff -r 53ab91264a3c -r c430af47dec1 sys/dev/usb/ehci.c
--- a/sys/dev/usb/ehci.c        Tue Feb 25 18:40:43 2020 +0000
+++ b/sys/dev/usb/ehci.c        Tue Feb 25 18:50:29 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ehci.c,v 1.267.2.1 2020/02/10 18:50:29 martin Exp $ */
+/*     $NetBSD: ehci.c,v 1.267.2.2 2020/02/25 18:50:29 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.267.2.1 2020/02/10 18:50:29 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.267.2.2 2020/02/25 18:50:29 martin Exp $");
 
 #include "ohci.h"
 #include "uhci.h"
@@ -3813,7 +3813,7 @@
 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();
 
@@ -3822,6 +3822,8 @@
        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);
 }
 
 /*
diff -r 53ab91264a3c -r c430af47dec1 sys/dev/usb/ohci.c
--- a/sys/dev/usb/ohci.c        Tue Feb 25 18:40:43 2020 +0000
+++ b/sys/dev/usb/ohci.c        Tue Feb 25 18:50:29 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ohci.c,v 1.289.4.3 2019/12/14 12:35:58 martin Exp $    */
+/*     $NetBSD: ohci.c,v 1.289.4.4 2020/02/25 18:50:29 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.289.4.3 2019/12/14 12:35:58 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.289.4.4 2020/02/25 18:50:29 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -2915,6 +2915,8 @@
        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);
 }
 
 /************************/
diff -r 53ab91264a3c -r c430af47dec1 sys/dev/usb/uhci.c
--- a/sys/dev/usb/uhci.c        Tue Feb 25 18:40:43 2020 +0000
+++ b/sys/dev/usb/uhci.c        Tue Feb 25 18:50:29 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uhci.c,v 1.288 2019/02/17 04:17:52 rin Exp $   */
+/*     $NetBSD: uhci.c,v 1.288.4.1 2020/02/25 18:50:29 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.288 2019/02/17 04:17:52 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.288.4.1 2020/02/25 18:50:29 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -2848,6 +2848,7 @@
        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. */
diff -r 53ab91264a3c -r c430af47dec1 sys/external/bsd/dwc2/dwc2.c
--- a/sys/external/bsd/dwc2/dwc2.c      Tue Feb 25 18:40:43 2020 +0000
+++ b/sys/external/bsd/dwc2/dwc2.c      Tue Feb 25 18:50:29 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dwc2.c,v 1.59.4.1 2019/12/09 13:06:38 martin Exp $     */
+/*     $NetBSD: dwc2.c,v 1.59.4.2 2020/02/25 18:50:29 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.59.4.1 2019/12/09 13:06:38 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.59.4.2 2020/02/25 18:50:29 martin Exp $");
 
 #include "opt_usb.h"
 
@@ -767,9 +767,13 @@
 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



Home | Main Index | Thread Index | Old Index