Index: subr_autoconf.c =================================================================== RCS file: /cvs/src/sys/kern/subr_autoconf.c,v retrieving revision 1.80 diff -u -p -r1.80 subr_autoconf.c --- subr_autoconf.c 18 Sep 2014 18:54:29 -0000 1.80 +++ subr_autoconf.c 5 Jan 2015 04:05:14 -0000 @@ -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); } }