aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/sysfs/dir.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index a0da2b05a754..54ca4bc02dcf 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -130,8 +130,10 @@ struct dentry *sysfs_get_dentry(struct sysfs_dirent *sd)
130 130
131 /* look it up */ 131 /* look it up */
132 parent_dentry = dentry; 132 parent_dentry = dentry;
133 mutex_lock(&parent_dentry->d_inode->i_mutex);
133 dentry = lookup_one_len_kern(cur->s_name, parent_dentry, 134 dentry = lookup_one_len_kern(cur->s_name, parent_dentry,
134 strlen(cur->s_name)); 135 strlen(cur->s_name));
136 mutex_unlock(&parent_dentry->d_inode->i_mutex);
135 dput(parent_dentry); 137 dput(parent_dentry);
136 138
137 if (IS_ERR(dentry)) { 139 if (IS_ERR(dentry)) {