diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c index dc20a601fcb5..e51ca4fd7db0 100644 --- a/sys/fs/devfs/devfs_vnops.c +++ b/sys/fs/devfs/devfs_vnops.c @@ -197,7 +197,7 @@ devfs_allocv(struct devfs_dirent *de, struct mount *mp, struct vnode **vpp, stru vp->v_type = VCHR; VI_LOCK(vp); dev_lock(); - dev->si_refcount++; + dev_ref(dev); vp->v_rdev = dev; SLIST_INSERT_HEAD(&dev->si_hlist, vp, v_specnext); dev->si_usecount += vp->v_usecount; diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c index 5575e6b2b92a..12402cb1383e 100644 --- a/sys/kern/kern_conf.c +++ b/sys/kern/kern_conf.c @@ -81,9 +81,8 @@ void dev_ref(struct cdev *dev) { - dev_lock(); + mtx_assert(&devmtx, MA_OWNED); dev->si_refcount++; - dev_unlock(); } void