Module Name: src
Committed By: skrll
Date: Thu May 27 11:09:15 UTC 2021
Modified Files:
src/sys/dev/usb: xhci.c
Log Message:
Fix error handling botch in 1.138. Thanks to jmcneill@ for spotting it.
To generate a diff of this commit:
cvs rdiff -u -r1.141 -r1.142 src/sys/dev/usb/xhci.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/dev/usb/xhci.c
diff -u src/sys/dev/usb/xhci.c:1.141 src/sys/dev/usb/xhci.c:1.142
--- src/sys/dev/usb/xhci.c:1.141 Wed May 26 22:37:21 2021
+++ src/sys/dev/usb/xhci.c Thu May 27 11:09:15 2021
@@ -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 @@ xhci_init_slot(struct usbd_device *dev,
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 @@ xhci_init_slot(struct usbd_device *dev,
return USBD_NORMAL_COMPLETION;
+bad1:
usb_freemem(&sc->sc_bus, &xs->xs_dc_dma);
xs->xs_idx = 0;
return USBD_NOMEM;