summaryrefslogtreecommitdiff
path: root/sys/dev/usb/usb_subr.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2017-03-26 15:31:16 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2017-03-26 15:31:16 +0000
commit0960796318a49681f95e509960991339c8e9ccbe (patch)
tree901b97163c8b0a266ffe9f5e62376af6356551be /sys/dev/usb/usb_subr.c
parentaeee42adf59ba123e92b0d27d239de085540f864 (diff)
Add sizes to various free(9) calls. Fixing the simpler ones first.
ok natano visa
Diffstat (limited to 'sys/dev/usb/usb_subr.c')
-rw-r--r--sys/dev/usb/usb_subr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/usb/usb_subr.c b/sys/dev/usb/usb_subr.c
index d3165bc8157..ae330debbff 100644
--- a/sys/dev/usb/usb_subr.c
+++ b/sys/dev/usb/usb_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usb_subr.c,v 1.131 2016/09/19 16:46:10 mpi Exp $ */
+/* $OpenBSD: usb_subr.c,v 1.132 2017/03/26 15:31:15 deraadt Exp $ */
/* $NetBSD: usb_subr.c,v 1.103 2003/01/10 11:19:13 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $ */
@@ -1398,7 +1398,7 @@ usbd_get_cdesc(struct usbd_device *dev, int index, u_int *lenp)
cdesc = malloc(len, M_TEMP, M_WAITOK);
err = usbd_get_desc(dev, UDESC_CONFIG, index, len, cdesc);
if (err) {
- free(cdesc, M_TEMP, 0);
+ free(cdesc, M_TEMP, len);
return (0);
}
}
@@ -1435,7 +1435,7 @@ usb_free_device(struct usbd_device *dev)
if (dev->serial != NULL)
free(dev->serial, M_USB, USB_MAX_STRING_LEN);
- free(dev, M_USB, 0);
+ free(dev, M_USB, sizeof *dev);
}
/*