Index: subr_autoconf.c =================================================================== RCS file: /cvs/src/sys/kern/subr_autoconf.c,v retrieving revision 1.84 diff -u -p -r1.84 subr_autoconf.c --- subr_autoconf.c 22 Jan 2015 01:19:51 -0000 1.84 +++ subr_autoconf.c 9 Feb 2015 11:24:17 -0000 @@ -922,7 +922,7 @@ device_mpath(void) void device_ref(struct device *dv) { - dv->dv_ref++; + atomic_inc_int(&dv->dv_ref); } /* @@ -937,8 +937,7 @@ device_unref(struct device *dv) { struct cfattach *ca; - dv->dv_ref--; - if (dv->dv_ref == 0) { + if (atomic_dec_int_nv(&dv->dv_ref) == 0) { ca = dv->dv_cfdata->cf_attach; free(dv, M_DEVBUF, ca->ca_devsize); }