summaryrefslogtreecommitdiffstats
path: root/sys/dev/i2c/ihidev.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2017-04-08 02:57:23 +0000
committerderaadt <deraadt@openbsd.org>2017-04-08 02:57:23 +0000
commit234dfda1d7a62906fbb92807fc733a3692f94f12 (patch)
treeed8f7c69222efdd27a1469fae991a63ce2bbff7f /sys/dev/i2c/ihidev.c
parentTwo prototypes for acpi_maptable; merge to one place (diff)
downloadwireguard-openbsd-234dfda1d7a62906fbb92807fc733a3692f94f12.tar.xz
wireguard-openbsd-234dfda1d7a62906fbb92807fc733a3692f94f12.zip
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/i2c/ihidev.c')
-rw-r--r--sys/dev/i2c/ihidev.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/i2c/ihidev.c b/sys/dev/i2c/ihidev.c
index a416e34abec..269fe74628c 100644
--- a/sys/dev/i2c/ihidev.c
+++ b/sys/dev/i2c/ihidev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ihidev.c,v 1.12 2016/04/23 09:40:28 kettenis Exp $ */
+/* $OpenBSD: ihidev.c,v 1.13 2017/04/08 02:57:23 deraadt Exp $ */
/*
* HID-over-i2c driver
*
@@ -209,7 +209,7 @@ ihidev_detach(struct device *self, int flags)
}
if (sc->sc_ibuf != NULL) {
- free(sc->sc_ibuf, M_DEVBUF, 0);
+ free(sc->sc_ibuf, M_DEVBUF, sc->sc_isize);
sc->sc_ibuf = NULL;
}