summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2015-01-19 06:27:58 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2015-01-19 06:27:58 +0000
commit9fa28a0355630bbc280758896d937700a9655277 (patch)
tree821bdbaa6b1d583c6d6758650cfc17aa97199fe2 /sys/kern
parent7d6a8c8a2b0574e8d8399449ac6a00b2091d60e8 (diff)
pass the size of the softc to free.
ok deraadt@
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/subr_autoconf.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/kern/subr_autoconf.c b/sys/kern/subr_autoconf.c
index 00b988e7c29..7bb3acec49f 100644
--- a/sys/kern/subr_autoconf.c
+++ b/sys/kern/subr_autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_autoconf.c,v 1.80 2014/09/18 18:54:29 kettenis Exp $ */
+/* $OpenBSD: subr_autoconf.c,v 1.81 2015/01/19 06:27:57 dlg Exp $ */
/* $NetBSD: subr_autoconf.c,v 1.21 1996/04/04 06:06:18 cgd Exp $ */
/*
@@ -935,8 +935,10 @@ device_ref(struct device *dv)
void
device_unref(struct device *dv)
{
+ struct cfattach *ca = dv->dv_cfdata->cf_attach;
+
dv->dv_ref--;
if (dv->dv_ref == 0) {
- free(dv, M_DEVBUF, 0);
+ free(dv, M_DEVBUF, ca->ca_devsize);
}
}