aboutsummaryrefslogtreecommitdiffstats
path: root/fs/sysfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/sysfs')
-rw-r--r--fs/sysfs/inode.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c
index 732fd7f371e0..ee31bf369a88 100644
--- a/fs/sysfs/inode.c
+++ b/fs/sysfs/inode.c
@@ -285,7 +285,7 @@ void sysfs_drop_dentry(struct sysfs_dirent *sd)
285int sysfs_hash_and_remove(struct dentry * dir, const char * name) 285int sysfs_hash_and_remove(struct dentry * dir, const char * name)
286{ 286{
287 struct sysfs_dirent **pos, *sd; 287 struct sysfs_dirent **pos, *sd;
288 struct sysfs_dirent *parent_sd = dir->d_fsdata; 288 struct sysfs_dirent *parent_sd;
289 int found = 0; 289 int found = 0;
290 290
291 if (!dir) 291 if (!dir)
@@ -295,6 +295,7 @@ int sysfs_hash_and_remove(struct dentry * dir, const char * name)
295 /* no inode means this hasn't been made visible yet */ 295 /* no inode means this hasn't been made visible yet */
296 return -ENOENT; 296 return -ENOENT;
297 297
298 parent_sd = dir->d_fsdata;
298 mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_PARENT); 299 mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_PARENT);
299 for (pos = &parent_sd->s_children; *pos; pos = &(*pos)->s_sibling) { 300 for (pos = &parent_sd->s_children; *pos; pos = &(*pos)->s_sibling) {
300 sd = *pos; 301 sd = *pos;