summaryrefslogtreecommitdiff
path: root/sys/dev/usb/if_athn_usb.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/if_athn_usb.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/if_athn_usb.c')
-rw-r--r--sys/dev/usb/if_athn_usb.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/usb/if_athn_usb.c b/sys/dev/usb/if_athn_usb.c
index 6c0b88c715f..b5726cb61e7 100644
--- a/sys/dev/usb/if_athn_usb.c
+++ b/sys/dev/usb/if_athn_usb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_athn_usb.c,v 1.46 2017/03/26 15:31:15 deraadt Exp $ */
+/* $OpenBSD: if_athn_usb.c,v 1.47 2017/04/08 02:57:25 deraadt Exp $ */
/*-
* Copyright (c) 2011 Damien Bergamini <damien.bergamini@free.fr>
@@ -391,6 +391,7 @@ athn_usb_open_pipes(struct athn_usb_softc *usc)
usc->usb_dev.dv_xname);
goto fail;
}
+ usc->ibuflen = isize;
error = usbd_open_pipe_intr(usc->sc_iface, AR_PIPE_RX_INTR,
USBD_SHORT_XFER_OK, &usc->rx_intr_pipe, usc, usc->ibuf, isize,
athn_usb_intr, USBD_DEFAULT_INTERVAL);
@@ -433,7 +434,7 @@ athn_usb_close_pipes(struct athn_usb_softc *usc)
usc->rx_intr_pipe = NULL;
}
if (usc->ibuf != NULL) {
- free(usc->ibuf, M_USBDEV, 0);
+ free(usc->ibuf, M_USBDEV, usc->ibuflen);
usc->ibuf = NULL;
}
}