X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/b0d623f7f2ae71ed96e60569f61f9a9a27016e80..143464d58d2bd6378e74eec636961ceb0d32fb91:/bsd/miscfs/devfs/devfs_tree.c diff --git a/bsd/miscfs/devfs/devfs_tree.c b/bsd/miscfs/devfs/devfs_tree.c index d8f3ae088..daf8c8ace 100644 --- a/bsd/miscfs/devfs/devfs_tree.c +++ b/bsd/miscfs/devfs/devfs_tree.c @@ -148,6 +148,7 @@ lck_grp_t * devfs_lck_grp; lck_grp_attr_t * devfs_lck_grp_attr; lck_attr_t * devfs_lck_attr; lck_mtx_t devfs_mutex; +lck_mtx_t devfs_attr_mutex; devdirent_t * dev_root = NULL; /* root of backing tree */ struct devfs_stats devfs_stats; /* hold stats */ @@ -185,6 +186,7 @@ devfs_sinit(void) devfs_lck_attr = lck_attr_alloc_init(); lck_mtx_init(&devfs_mutex, devfs_lck_grp, devfs_lck_attr); + lck_mtx_init(&devfs_attr_mutex, devfs_lck_grp, devfs_lck_attr); DEVFS_LOCK(); error = dev_add_entry("root", NULL, DEV_DIR, NULL, NULL, NULL, &dev_root); @@ -1050,12 +1052,12 @@ dev_free_name(devdirent_t * dirent_p) if(dnp->dn_linklist == dirent_p) { dnp->dn_linklist = dirent_p->de_nextlink; } - dirent_p->de_nextlink->de_prevlinkp - = dirent_p->de_prevlinkp; - *dirent_p->de_prevlinkp = dirent_p->de_nextlink; } devfs_dn_free(dnp); } + + dirent_p->de_nextlink->de_prevlinkp = dirent_p->de_prevlinkp; + *(dirent_p->de_prevlinkp) = dirent_p->de_nextlink; /* * unlink ourselves from the directory on this plane