From b0eecd7ac065e56de0cf7fb0bed75accd472adb1 Mon Sep 17 00:00:00 2001 From: dlg Date: Mon, 19 Jan 2015 06:27:57 +0000 Subject: [PATCH] pass the size of the softc to free. ok deraadt@ --- sys/kern/subr_autoconf.c | 6 ++++-- 1 file 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); } } -- 2.20.1