summaryrefslogtreecommitdiff
path: root/sys/dev/usb/usps.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2017-04-08 02:57:26 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2017-04-08 02:57:26 +0000
commitbbfe5cc76c1caf2b1b5fcc22429b420fdec501f8 (patch)
tree96f1934f62e4c72a1c903e650d612858ae90e9d6 /sys/dev/usb/usps.c
parentb2ed98c2714b1414dd6b981eb8733a1d7d4a689c (diff)
A pile of sizes to free(9). In test for a few days in snapshots.
Errors will result in nice clean panic messages so we know what's wrong. Reviewed by dhill visa natano jsg.
Diffstat (limited to 'sys/dev/usb/usps.c')
-rw-r--r--sys/dev/usb/usps.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/usb/usps.c b/sys/dev/usb/usps.c
index eff543ac242..7ec16c9c4fe 100644
--- a/sys/dev/usb/usps.c
+++ b/sys/dev/usb/usps.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usps.c,v 1.8 2016/11/06 12:58:01 mpi Exp $ */
+/* $OpenBSD: usps.c,v 1.9 2017/04/08 02:57:25 deraadt Exp $ */
/*
* Copyright (c) 2011 Yojiro UO <yuo@nui.org>
@@ -283,8 +283,8 @@ fail:
usbd_close_pipe(sc->sc_ipipe);
if (sc->sc_xfer != NULL)
usbd_free_xfer(sc->sc_xfer);
- if (sc->sc_intrbuf != NULL)
- free(sc->sc_intrbuf, M_USBDEV, 0);
+ if (sc->sc_intrbuf != NULL)
+ free(sc->sc_intrbuf, M_USBDEV, sc->sc_isize);
}
int
@@ -300,7 +300,7 @@ usps_detach(struct device *self, int flags)
usbd_abort_pipe(sc->sc_ipipe);
usbd_close_pipe(sc->sc_ipipe);
if (sc->sc_intrbuf != NULL)
- free(sc->sc_intrbuf, M_USBDEV, 0);
+ free(sc->sc_intrbuf, M_USBDEV, sc->sc_isize);
sc->sc_ipipe = NULL;
}
if (sc->sc_xfer != NULL)