From: dlg Date: Mon, 19 Jan 2015 06:27:57 +0000 (+0000) Subject: pass the size of the softc to free. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=b0eecd7ac065e56de0cf7fb0bed75accd472adb1;p=openbsd pass the size of the softc to free. ok deraadt@ --- 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); } }