Index: subr_autoconf.c =================================================================== RCS file: /cvs/src/sys/kern/subr_autoconf.c,v retrieving revision 1.83 diff -u -p -r1.83 subr_autoconf.c --- subr_autoconf.c 19 Jan 2015 23:01:07 -0000 1.83 +++ subr_autoconf.c 21 Jan 2015 02:02:37 -0000 @@ -935,8 +935,11 @@ device_ref(struct device *dv) void device_unref(struct device *dv) { + struct cfattach *ca; + dv->dv_ref--; if (dv->dv_ref == 0) { - free(dv, M_DEVBUF, 0); + ca = dv->dv_cfdata->cf_attach; + free(dv, M_DEVBUF, ca->ca_devsize); } }