Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb Fix error handling botch in 1.138. Thanks to jmc...



details:   https://anonhg.NetBSD.org/src/rev/ae372fe8310e
branches:  trunk
changeset: 983504:ae372fe8310e
user:      skrll <skrll%NetBSD.org@localhost>
date:      Thu May 27 11:09:15 2021 +0000

description:
Fix error handling botch in 1.138. Thanks to jmcneill@ for spotting it.

diffstat:

 sys/dev/usb/xhci.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (35 lines):

diff -r b5f7acd946eb -r ae372fe8310e sys/dev/usb/xhci.c
--- a/sys/dev/usb/xhci.c        Thu May 27 10:44:29 2021 +0000
+++ b/sys/dev/usb/xhci.c        Thu May 27 11:09:15 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xhci.c,v 1.141 2021/05/26 22:37:21 riastradh Exp $     */
+/*     $NetBSD: xhci.c,v 1.142 2021/05/27 11:09:15 skrll Exp $ */
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.141 2021/05/26 22:37:21 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.142 2021/05/27 11:09:15 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -3437,7 +3437,7 @@
        if (err) {
                DPRINTFN(1, "failed to allocmem input device context %jd",
                    err, 0, 0, 0);
-               return USBD_NOMEM;
+               goto bad1;
        }
 
        memset(&xs->xs_xr[0], 0, sizeof(xs->xs_xr));
@@ -3445,6 +3445,7 @@
 
        return USBD_NORMAL_COMPLETION;
 
+bad1:
        usb_freemem(&sc->sc_bus, &xs->xs_dc_dma);
        xs->xs_idx = 0;
        return USBD_NOMEM;



Home | Main Index | Thread Index | Old Index